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

last 3 Month Trending

Hi,  need to have a 3 month bar chart based on the below data and it should change automatically on change of month/year.  please let me know if anyone can help me here..thnx

  

MonthEndDateABC
1/31/2016110.380
2/28/2016215.680
3/31/2016320.980
4/30/2016426.280
5/31/2016531.580
6/30/2016636.880
7/31/2016742.180
8/31/2016847.480
9/30/2016952.780
10/31/2016105880
11/30/20161163.380
12/31/20161268.680
1/31/20171373.980
2/28/20171479.280
3/31/20171584.580


13 Replies
Anil_Babu_Samineni

Which metric you want to use here. This case, You want after selection. May be this?

Sum({<MonthEndDate = {">= AddMonths(Max(MonthEndDate),-3) <= Max(MonthEndDate)"}>}A+B+C)

Or

with date format

Sum({<MonthEndDate = {">= Date(AddMonths(Max(MonthEndDate),-3),'MM/DD/YYYY') <= Date(Max(MonthEndDate),'MM/DD/YYYY')"}>}A+B+C)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Thnx Anil. For some reason i am getting 0 as a result and chart is not appearing..Any idea why?

Anil_Babu_Samineni

Can you select 3/31/2017? Then look the data

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anil_Babu_Samineni

My Fault,

Sum({<MonthEndDate = {">= $(=Date(AddMonths(Max(MonthEndDate),-3),'MM/DD/YYYY')) <= $(=Date(Max(MonthEndDate),'MM/DD/YYYY'))"}>}A+B+C)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Its still 0. thnx

Anonymous
Not applicable
Author

sry, no luck..showing 0..

Anil_Babu_Samineni

Would you share sample qvw

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Anonymous
Not applicable
Author

Sorry, due to privacy I cant..but  below one worked Also tested by selecting the dates and it works fine.. Now how can I have a  MM-YYYY format and select instead of date... thnx for your help

=sum({<MonthEndDate={'>=$(=MonthStart(Max(MonthEndDate),-3))<=$(=MonthStart(Max(MonthEndDate),1))'}>}  A+B+C)

Anil_Babu_Samineni

May be MonthName(MonthEndDate,'MM-YYYY') or MonthName(MonthEndDate)

Your expression seems you want to show Measure for last three months data with starting date of Month and till This month(I meant, Selection) of monthstart date. That case above condition should work. From here you can make in set analysis

=sum({<MonthEndDate={'>=$(=Date(MonthStart(Max(MonthEndDate),-3)),'YourDateFormat')<=$(=Date(MonthStart(Max(MonthEndDate),1)),'YourDateFormat')'}>}  A+B+C)

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful