Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysiss

Hi

Can someone please change this to set analysis. I have been battling for probably an hour and i can't seem to get it Right.

This is for a CY MTD Calculation on sales.

sum(IF(Year = Year(Today()),IF( MonthNumber >= 01 and MonthNumber <= Num(Month(Today())),Sales)))

Thanks,

3 Replies
sparur
Specialist II
Specialist II

Hello.

try that:

sum({<Year = {$(=Year(Today()))}, MonthNumber = {$(=Month(Today()))}>} Sales)

but if it not work, you should to create 2 variables: vYear = year(today()) and vMonth = Month(Today())

and change expression:

sum({<Year = {$(vYear)}, MonthNumber = {$(vMonth)}>} Sales)

Not applicable
Author

Not one of them worked... MonthNumber Gets returned as 01,02,03 etc.

and if you look at your calculation, its not a MTD. (Its needs to be Year = Year , Month >= 01 and Month<=Month(Today()))

Please have a look at the if statement above...

Thanks,

sparur
Specialist II
Specialist II

sorry,

sum({<Year = {$(vYear)}, MonthNumber = {"<=$(vMonth)"}>} Sales)