Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
paul_hallwood
Contributor II
Contributor II

Issue with Formula

I'm trying to sum all the activity for a particular chosen financial year, but for some reason I can't get it to work.  Here is the formula:

=Sum({$<[FiscalYear]={$(varFiscalYear)}>} [Activity])

varFiscalYear is a variable that evaluates to 2016_17.  The error message I get is "Error: Error in set modifier adhoc element list: ',' or ')' expected" but I'm not too sure what the issue is.  Any help with this will be much appreciated.

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

Try one of these:

=Sum({$<[FiscalYear]={'$(=varFiscalYear)'}>} [Activity])

=Sum({$<[FiscalYear]={'$(=$(varFiscalYear))'}>} [Activity])

View solution in original post

6 Replies
sunny_talwar
MVP
MVP

May be try this:

=Sum({$<[FiscalYear]={$(=varFiscalYear)}>} [Activity])

paul_hallwood
Contributor II
Contributor II
Author

No, that hasn't worked unfortunately.  Thanks for the speedy response though!

paul_hallwood
Contributor II
Contributor II
Author

...if I substitute the varFiscalYear for '2016_17' the formula seems to work.  Here is the working formula:

=Sum({$<[FiscalYear]={'2016_17'}>} [Activity])

Would declaring varFiscalYear as a variable and then using it in a formula be causing it any problems at all???

sunny_talwar
MVP
MVP

Try one of these:

=Sum({$<[FiscalYear]={'$(=varFiscalYear)'}>} [Activity])

=Sum({$<[FiscalYear]={'$(=$(varFiscalYear))'}>} [Activity])

paul_hallwood
Contributor II
Contributor II
Author

Yes, it seems as though your first formula has done what I have wanted!  Brilliant - thank you very much for your responses, they've been much appreciated.

sunny_talwar
MVP
MVP

Brilliant