Functions : Can I pass a value from a page parameter to a function ?
- float panel_calcs.sum_NowYTD_PreviousYear()
- {
- sum = carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted);
- if(carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted) == null)
- {
- sum = 0.0;
- }
- else
- {
- sum = carbon[organisation == thisapp.Navigation.getOrganisation() && end_date >= today.subYear(2) && end_date < today.subYear(1)].sum(carbon_emitted);
- }
- return sum.round(2);
- }