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: 
Anonymous
Not applicable

MonthYear MonthYear - 1 in Bar Chart


All,

I am trying to create a bar chart that has 1 dimension MonthYear with no selections.  I want to show quantity of current month and last year same month.

Any advice on the formulas to do so?

Thank you!

7 Replies
Gysbert_Wassenaar

If you're using MonthYear as a dimension and want to show each MonthYear along with its corresponding month from the year before you neeed an AsOf table that links each MonthYear value with it corresponding year-before month. See this document: Calculating rolling n-period totals, averages or other aggregations


talk is cheap, supply exceeds demand
Not applicable
Author

Hi

Try this in your expression

=SUM({<[Date Field]={">=$(=MonthStart((Max([Date Field])))<=$(=MonthEnd((Max([Date Field])))"},Year=,Month=,Quarter=>

+

<[Date Field]={">=$(=MonthStart((Max([Order Date])),-12))<=$(=MonthEnd((Max([Date Field]),-12))"},Year=,Month=,Quarter=>}Fieldname)

-12 here specifies the same moth in previous year

Anonymous
Not applicable
Author

This is not working... I am only using MonthYear as my dimension.

Not applicable
Author

Hi,

This is working for month year dimension too if possible pls post your sample file

Anonymous
Not applicable
Author

here is a screen shotCapture.JPG.jpg

Not applicable
Author

Can you post a sample app with small data?

Anonymous
Not applicable
Author

Here is a sample file.