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: 
Anonymous
Not applicable

Set expression issue into Chart

Hello,

I am a beginner on QlikView and i would like to do a Month to Day and a Year to day report on QlikView.

To do that i have a table "AsOf", With different data of End of Month and a table "Period" where we can select "YTD" or "MTD".

So when YTD is selected, i would like just the result of the AsOf, but when "MTD" is selected i would like to have the difference between two AsOf Result.

I tried this Expression:

IF( Period = 'YTD',SUM(STE), IF( Period = 'MTD',SUM(STE) - SUM({$< AsOf = {"=$(=Num(AddMonths(Max(AsOf),-1)))"}>} STE)))

but it doesn't work 😕

You can check my sample attached.

Thank you in advance for your help,

Sébastien.

Labels (1)
2 Replies
sunny_talwar
MVP
MVP

Can you check this:

IF(Period = 'YTD', SUM(STE),

IF(Period = 'MTD', SUM(STE) - Sum(TOTAL {$< AsOF = {"$(='>=' & Num(MonthStart(Max(AsOF),-1)) & '<=' & Num(MonthEnd(Max(AsOF),-1)))"}>} STE)))


UPDATE: You need to be carefully about Upper case and lower case in your file. You used AsOf instead of AsOF

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

AsOf is not AsOF. Use the exact case sensitive field names

=IF( Period = 'YTD',SUM(STE), IF( Period = 'MTD',SUM(STE) - SUM({$< AsOF = {$(=Num(AddMonths(Max(AsOF),-1)))}>} STE)))


talk is cheap, supply exceeds demand