Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space DEV and version next

...

First, you want to sum up the invalid registrations (invalidReg) by cityfor precincts that are already on the watchlist (precinctWatchList = y). These sums are grouped by city, which can span multiple precincts:

D trans
RawWrangletrue
p03ValuecityId
Typestep
WrangleTextderive type:single value:SUMIF(invalidReg, precinctWatchList == "y") group:cityId as:'invalidRegbyCityId'
p01NameFormula type
p01ValueSingle row formula
p02NameFormula
p02ValueSUMIF(invalidReg, precinctWatchList == "y")
p03NameGroup rows by
p04Value'invalidRegbyCityId'
p04NameNew column name
SearchTermNew formula

The invalidRegbyCityId column contains invalid registrations across the entire city.

Now, at the county level, you want to identify the number of precincts that were on the watch list and were part of a city-wide registration problem.

In the following step, the number of cities in each count are counted where invalid registrations within a city is greater than 60.

  • This step

...

  • creates a pivot aggregation.

D trans
RawWrangletrue
p03Value1
Typestep
WrangleTextpivot value:COUNTDISTINCTIF(precinctId, invalidRegbyCityId > 60) group:countyId limit:1
p01NameRow labels
p01ValuecountyId
p02NameValues
p02ValueCOUNTDISTINCTIF(precinctId, invalidRegbyCityId > 60)
p03NameMax number of columns to create
SearchTermPivot columns

...