Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
rkpatelqlikview
Creator III
Creator III

How to show last 3 months sales for maximum date of the month

Dear Qlik,

Please suggest on this.

Here i have months and trend analysis in Bar chart

Dimension-> Month,

Expression - > 

round(count({<Date={"$(=max(Date))"},[Difference Category]={'7Days'}>} DISTINCT Items)/

Count(DISTINCT{<Date={"$(=max(Date))"}>} Items *100,0.01,0).

I can able to see only recent month bar.

Please find the below screen shot for your reference.

i should see the sep and aug months with calculation of the maximum date of that particular month. Please advice how to overcome this,

trend1.JPGtrend2.JPG

Thanks in Advance.

1 Solution

Accepted Solutions
Sergey_Shuklin
Specialist
Specialist

Now I see the point. So, there are many ways how to get max day of the month, but I prefer to add one more column as flag of max day.

max_month_date.png

And then use a simple set analysis condition: end_month = {1}

hope this way will be suitable for you

View solution in original post

4 Replies
Sergey_Shuklin
Specialist
Specialist

Hello!

Improve your set condition with Addmonths function:

Date={">$(=monthstart(Addmonths(max(Date),-2)))"} if your month field ends with the last day of month.

rkpatelqlikview
Creator III
Creator III
Author

Thanks Sergey,

Thanks for your response.

I tried with this one but values are not correct. It taking entire month data not max date of the month.

Please find the below screen shot and attached QVW as well.

Thanks in advance.

trend3.JPG

Sergey_Shuklin
Specialist
Specialist

Now I see the point. So, there are many ways how to get max day of the month, but I prefer to add one more column as flag of max day.

max_month_date.png

And then use a simple set analysis condition: end_month = {1}

hope this way will be suitable for you

rkpatelqlikview
Creator III
Creator III
Author

Thanks for your great help.

It's working good. Thanks once again.