Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

mhapanka
New Contributor III

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
MVP
MVP

Re: Sales for specific months only, but across years only

Then use fiscal month to calculated monthnum

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

6 Replies
MVP
MVP

Re: Sales for specific months only, but across years only

May be do this

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

Where NumMonth is created in the script

Num(Month(Date)) as NumMonth

mhapanka
New Contributor III

Re: Sales for specific months only, but across years only

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

MVP
MVP

Re: Sales for specific months only, but across years only

Does Fiscal Year include Month information?

mhapanka
New Contributor III

Re: Sales for specific months only, but across years only

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

MVP
MVP

Re: Sales for specific months only, but across years only

Then use fiscal month to calculated monthnum

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

mhapanka
New Contributor III

Re: Sales for specific months only, but across years only

Thank you so much!