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

Help on Dynamic Set Analysis on Months

Hi Guys,

I really need your help regarding set analysis. I want to have a dynamic Chart that shows Current Month, Previous Month and Last year Sales. For example, I choose Year =2010 and Month=March. The chart must show: Current Month=March, Previous Month=February and Last year = March (2009).

Hope you can help me on my problem.

Thanks!

Lester

7 Replies
Not applicable
Author

Try this:


Sum({$<Year={$(=Max(Year))},Month={$(=Max(Month))}>} SalValue) //Current month value

Sum({$<Year={$(=Max(Year))},Month={$(=Max(Month)-1)}>} SalValue) //Previous month value

Sum({$<Year={$(=Max(Year-1))},Month={$(=Max(Month))}>} SalValue) //Previous year current month value


Not applicable
Author

Hi dsjain,

Thanks for immediate reply. I don't know what is the problem, but it seems that the code is not working for me. Can you upload a sample .qvw that uses this code? I think you already used this code before and worked for you..

Please.. please..

Thanks,

Lester

Not applicable
Author

Tell me whats the problem first. I don't have any samples for this. It's better if you let me know the outcome.

Not applicable
Author

The result is 0 (zero). It seems the set analysis code is correct, but I don't know the problem why it doesn't work for me. That's the reason why I ask if you have a sample .qvw that uses this code. Anyways, have you tried to use this set analysis code in any of your .qvw? Did it worked?

I really appreciate your help bro..

Thanks,

Lester

Not applicable
Author

Hi,

No i never used this before and it is not there in any of my document. I just tried in my document which i am working on and it gives accurate result. Send me the expression which you are using and also i want the sales field name.

Regards,

Rikab

Not applicable
Author

Thanks Paul! That's what I'm looking for.. Big Smile. Thanks to you too dsjain.

Not applicable
Author

Can you send me the set analysis which was working. I just wanted to check why this was not working.