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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
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
lironbaram
Partner - Master III
Partner - Master III

hi

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
Author

Thanks Liron

alexandros17
Partner - Champion III
Partner - Champion III

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
Author

Set Analysis: syntaxes, examples

You may find this post helpful for set analysis