Skip to content

Instantly share code, notes, and snippets.

@arothenberg
Last active December 13, 2015 18:38
Show Gist options
  • Save arothenberg/4957048 to your computer and use it in GitHub Desktop.
Save arothenberg/4957048 to your computer and use it in GitHub Desktop.
class bank_cross(bank_data):
data_cross= column('data','number')
data_cross.calc("Sum")
year_cross= column('year','number')
year_cross.cross_header(True)
year60_80=criteria("year>{1960} and year<={1980}")
year60_80.order(10)
year80_20=criteria("year>{1980} and year<={2000}")
year80_20.order(11)
year20_present=criteria("year>{2000} and year<={2012}")
year20_present.order(12)
year60_80.on()
#does not show up on form
yearcheck=conjunction()
yearcheck.add(year60_80,year80_20,year20_present)
usa=criteria("country_code={'USA'}")
usa.on()
like_filter= filter("Find","like '%","%'")
like_filter.fields(bank_data.indicator_code,bank_data.country_code,bank_data.year,"no_case")
filter_year_gt= filter("Year >=",">=")
filter_year_gt.fields(bank_data.year)
filter_year_lt= filter("Year <=","<=")
filter_year_lt.fields(bank_data.year)
country_code_filt = filter("Country Code =","=")
country_code_filt.fields(bank_data.country_code,"no_case")
indicator_code_filt = filter("Indicator Code =","=")
indicator_code_filt.fields(bank_data.indicator_code,"trim")
bank_data.country_code.change_order(1)
bank_data.indicator_code.change_order(2)
excluded_fields = exclude(bank_data.data,bank_data.country, bank_data.indicator,bank_data.source_note,bank_data.source_organization,bank_data.year)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment