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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Nested set analysis with max fuction

Hi,

I need to get max date for specific type of data, but I'm having a bit difficulties to get it work when the max function is inside set analysis. I'm trying to get max date only for TYPE Invoice, since type budget is messing up actual max dates. Can someone help me find what the issue with my code:

Sum({< YearMonth = {'>=$($(vCompare2))<=$(=Max({$<TYPE={'Invoice'}>}YearMonth))'}, Year=, MonthName=, Month=, Quarter=, Week= >} $(vGrossSales))

The part {$<TYPE={"Invoice"}>} is what I'm trying to add, but it seems to ignore type of the date, so there must be something wrong with my code?

1 Solution

Accepted Solutions
sunny_talwar

I am thinking its this part of the set analysis which might not be working:

Sum({<YearMonth = {">=$($(vCompare2))"}, Year=, MonthName=, Month=, Quarter=, Week= >} $(vGrossSales))

Can you check if this is working or not?

View solution in original post

4 Replies
sunny_talwar

Try with doube quotes:

Sum({< YearMonth = {">=$($(vCompare2))<=$(=Max({$<TYPE {'Invoice'}>}YearMonth))"}, Year=, MonthName=, Month=, Quarter=, Week= >} $(vGrossSales))

Not applicable
Author

Unfortunately that doesn't work !either, it now looks following:

Sum({<YearMonth = {">=$($(vCompare2))<=$(=Max({$<TYPE={'Invoice'}>}YearMonth))"},

Year=, MonthName=, Month=, Quarter=, Week= >} $(vGrossSales))

This gives me correct YearMonth, so the problem must be with set analysis:

=Max({<TYPE={'Invoice'}>}YearMonth)

sunny_talwar

I am thinking its this part of the set analysis which might not be working:

Sum({<YearMonth = {">=$($(vCompare2))"}, Year=, MonthName=, Month=, Quarter=, Week= >} $(vGrossSales))

Can you check if this is working or not?

Not applicable
Author

Thank you, that was it, taking budgets into account.