Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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

Re: Using a variable storing the whole set

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])

3 Replies

Re: Using a variable storing the whole set

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

Re: Using a variable storing the whole set

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])

Highlighted
Not applicable

Re: Using a variable storing the whole set

Thank You!

simple quote was the key

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

Community Browser