Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using a variable storing the whole set

Hello

Fabrice AUNEZ recommends to use the whole set syntax stored in variable like this:

sum({$ <$(vSet) >} [Volume Sales])


But syntax checker marks this sentence as wrong and field in diagram is not calculated.

Value of variable vSet assigned in Variable Overview:

SaleData={01.01.2014}


Where is the mistake?


Thank you


1 Solution

Accepted Solutions
rubenmarin

HI Pavel, syntax checker will mark the sentence as wrong, this is normal when using variables in set analysis but doesn't means it wouldn't work.

Check if SaleData format is dd.mm.yyyy and use simple quote in the data:

SaleData={'01.01.2014'}


You can try first to debug your expression, when it works would be easier to use the variables:

sum({$<SaleData={'01.01.2014'}>} [Volume Sales])

View solution in original post

3 Replies
Gysbert_Wassenaar

The 'mistake' is in the syntax checker. It cannot do dollar expansions since it cannot evaluate the expression in the context of the chart. That means the syntax cannot be verified. But it does not necessarily mean that the complete dollar-expanded expression will not work in the chart.


talk is cheap, supply exceeds demand
rubenmarin

HI Pavel, syntax checker will mark the sentence as wrong, this is normal when using variables in set analysis but doesn't means it wouldn't work.

Check if SaleData format is dd.mm.yyyy and use simple quote in the data:

SaleData={'01.01.2014'}


You can try first to debug your expression, when it works would be easier to use the variables:

sum({$<SaleData={'01.01.2014'}>} [Volume Sales])

Not applicable
Author

Thank You!

simple quote was the key

IMPOTANT REMARK: Do not use comments in field Definition of Variable Overview in this case!