Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pls explain the differnce in expression !

Hi All,

I m new to qlikview and currently exploring all the set analysis expression .

Please do me a great favour by explaining the differnce between the below 2 expressions .

I want to calculate last year YTD .

=sum({$<YR = {$(=max(YR)-1)}, MONTH_ID = {"<=$(=max({<YR={$(=max(YR))}>} MONTH_ID))"}>} SELL_IN_OUT_VALUE)

=sum({1<YR = {$(=MAX(YR)-1)},MONTH_DESC = >} SELL_IN_OUT_VALUE)

4 Replies


the first expression will calculate YTD of previous year according to the max month in this year

the second one will always calculate the sales in the whole previous year

Not applicable

Thanks Liron


sum(SELL_IN_OUT_VALUE) -> sum all values of field SELL_IN_OUT_VALUE

then there is set analysis.

The first $ means that sum is conditioned by selections

YR = {$(=max(YR)-1)}means that in the sum the field YR must be equal to Max(YR)-1, this value is computed so you need $(=value_to_compute)

MONTH_ID = {"<=$(=max({<YR={$(=max(YR))}>} MONTH_ID))"} means that field MONTH_ID must be equal to the max(month_id) for which the field YR is equal to Max(YR)

The second expression has 1 instead of $ this means that value is not conditioned by selections, when you write FIELD= this means : any value for that field

Hope it helps

Not applicable

Set Analysis: syntaxes, examples

You may find this post helpful for set analysis