Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
ankitg4688
Contributor III
Contributor III

Previous Month & Current Month for Rolling Expression

Hi,

I want to show Previous Month value and Current Month value in same hover box on current month. I have to roll both the expression for 13 Months. So every time when I hover on specific month it will show me Current and Previous Month values.

I chose Combo Chart for this. There is another Rolling month expression which creates line. Below two expressions will show details in hover box.

My Rolling Month expression for Current Month is

count(distinct { $< YEAR_MONTH= {" >= $(=date(addmonths(date(date#(Max(YEAR_MONTH),'YYYYMM'),'YYYYMM'), -12),'YYYYMM'  ))  =<  $(=date(addmonths(date(date#(Max(YEAR_MONTH),'YYYYMM'),'YYYYMM'), - 0),'YYYYMM'  ))" },

Type=1 > } Products )

My Rolling Month expression for Previous Month is

count(distinct { $< YEAR_MONTH= {" >= $(=date(addmonths(date(date#(Max(YEAR_MONTH),'YYYYMM'),'YYYYMM'), -13),'YYYYMM'  ))  =<  $(=date(addmonths(date(date#(Max(YEAR_MONTH),'YYYYMM'),'YYYYMM'), - 1),'YYYYMM'  ))" },

Type=1 > } Products )


But my second expression doesn't give value as needed. Can somebody help?


Thanks for sharing the knowledge.

Regards,

Ankit

6 Replies
vvira1316
Specialist II
Specialist II

Hi Ankit,

Will you be able to share sample data/app?

BR,

Vijay

ankitg4688
Contributor III
Contributor III
Author

Hi Vijay,

Thanks for your response. Sorry but I can't share sample data or app for this.

Br,

Ankit

vvira1316
Specialist II
Specialist II

Anil_Babu_Samineni

This part may be like below

count(distinct { $< YEAR_MONTH= {" >= $(=date(addmonths(date(date#(Max(YEAR_MONTH),'YYYYMM'),'YYYYMM'), -13),'YYYYMM'  ))  <=  $(=date(addmonths(date(date#(Max(YEAR_MONTH),'YYYYMM'),'YYYYMM'), - 1),'YYYYMM'  ))" },

Type={1} > } Products )

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
ankitg4688
Contributor III
Contributor III
Author

Hi Vijay,

Thanks for your response. First link will give me Aggregated value from start till current month. However, I want only that specific Previous Month's value and show it in current month's hover box and continue to roll for 12 months. Any other idea?

gwassenaar‌, vishsaggi‌ Could you please also suggest on this? This is quite urgent. Many Thanks.

Thanks for sharing the knowledge.

Br

Ankit

ankitg4688
Contributor III
Contributor III
Author

Hi Anil,

Thanks for correction. Sorry for typo error.

Thanks for sharing the knowledge.

Br

Ankit