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

Sales for specific months only, but across years only

Hi, I have a bar graph that denotes the sales of some products for the years 2016-2018. However since 2018 is only in the 8th month now I want to change this graph to show the sales for 8 month for the years 2016 and 2017 as well. Can anyone help me with a code to do this? I want it across years only, but showing only up to 8 months

I have data on Quarters as well as Months to enable the same but however I'm unsure of the code for this.

Capture2.PNG

1 Solution

Accepted Solutions
sunny_talwar

Then use fiscal month to calculated monthnum

Num(Month(Date#([fiscal month], 'YYYY/MM'))) as NumMonth

View solution in original post

6 Replies
sunny_talwar

May be do this

Sum({<NumMonth = {"<=$(=Num(Month(Today())))"}>}Sales)

Where NumMonth is created in the script

Num(Month(Date)) as NumMonth

mhapanka
Creator
Creator
Author

I do not have a field that has date, can i use[ fiscal year] in place of this?

sunny_talwar

Does Fiscal Year include Month information?

mhapanka
Creator
Creator
Author

no , Fiscal year has just 2016, 2017 and 2018

fiscal month is as follows: 2016/01 2016/02 and so on

and fiscal quarter is 2016 Q1, 2016 Q2 and so on

sunny_talwar

Then use fiscal month to calculated monthnum

Num(Month(Date#([fiscal month], 'YYYY/MM'))) as NumMonth

mhapanka
Creator
Creator
Author

Thank you so much!