Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Manuel06
Contributor
Contributor

Last 3 months separate on bar chart per product

Hello all,

I am trying to create a bar chart displaying the 3 latest months in one chart per product (or in this case the number of flights per aircraft). I am very new to Qlik Sense so any help or advice would be really appreciated!

_20190404_110201.JPG

Dates are loaded as follows:

Link:
LOAD
datetype,
date,
Day(date) as Ops_day,
Month(date) as Ops_month,
Year(date) as Ops_year

 

Thanks in advance,

Manuel

Labels (1)
3 Replies
Channa
Specialist III
Specialist III

=SUM({$<Date= {">=$(=AddMonths( MonthStart (Today()),-3))<=$(=MonthEnd(Today())"}>}Sales)

Channa
Shubham_Deshmukh
Specialist
Specialist

My Mistake, let me edit my answer
Shubham_Deshmukh
Specialist
Specialist

Hi @Manuel06 ,

Take Product as your Dimension and 3 expressions for 3 months,

Expression 1 : =sum(if(yourDateField>=MonthStart(AddMonths(Today(),-2)) and yourDateField<=MonthEnd(AddMonths(Today(),-2)), yourField))
Expression 2 : =sum(if(yourDateField>=MonthStart(AddMonths(Today(),-1))  and yourDateField<=MonthEnd(AddMonths(Today(),-1)), yourField))
Expression 3 : =sum(if(yourDateField>=MonthStart(Today()) and yourDateField>=MonthEnd(Today()), yourField))

Here I am taking 3 months Feb, Mar, Apr. Adjust AddMonths() parameter according to your requirement.

-Shubham