Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Talend Cloud AWS EU Scheduled Outage: Starting Tues 26 May 21:00 CEST with expected completion Wed 27 May 01:00 CEST
cancel
Showing results for 
Search instead for 
Did you mean: 
khadeer
Specialist
Specialist

Last 3 Months Sales?

Hi All,

I have to show last 3 months Sales data without reflecting any selections in same table respective of product....

my date field is posting date in YYYY-MM-DD format?

Please help me how i can achive this?

Labels (1)
7 Replies
nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

Try this Expression.

=Sum({<CalDate={'>=$(=MonthStart(Max(CalDate), -2))<=$(=MonthEnd(Max(CalDate)))'}, CalMonth=,CalQuarter=,CalYear= , CalMonthYear= >} Sales)

Regards,

Nirav Bhimani

nirav_bhimani
Partner - Specialist
Partner - Specialist

HI ,

See the attachment

Output as per your requirement.

EXP:

=Sum({< CalDate={'>=$(=MonthStart(Max( {<CalYear=, CalMonth= , CalMonthYear=, CalQuarter=>} CalDate), -2))<=$(=MonthEnd(Max( {<CalYear=, CalMonth= , CalMonthYear=, CalQuarter=>} CalDate)))'} , CalMonth=,CalQuarter=,CalYear= , CalMonthYear= >} Sales)

Reagrds,

Nirav Bhimani

khadeer
Specialist
Specialist
Author

Hi Nirav,

Thanx for ur reply....

I am not getting correct answer by that expression. I have to get  last 3 months sales expect this month means for present it is march so i have to show dec-12, jan-13,feb-13...... it doen't effect to my selection, suppose if i am seeing 2012 may data ... that data will be constanat..... for every selection

Regards,

Khadeer

nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

Try this updated exp:

=Sum({< CalDate={'>=$(=MonthStart(Max( {<CalYear=, CalMonth= , CalMonthYear=, CalQuarter=>} CalDate), -3))<=$(=MonthEnd(Max( {<CalYear=, CalMonth= , CalMonthYear=, CalQuarter=>} CalDate), -1))'} , CalMonth=,CalQuarter=,CalYear= , CalMonthYear= >} Sales)

Regards,

Nirav Bhimani

nizamsha
Specialist II
Specialist II

=sum({$<Month={">=$(=Max(Month)-3)<$(=Max(Month))"},Day=,Year={"2008"}>}[Sales Amount])

use this one it will help i think

nizamsha
Specialist II
Specialist II

u can nullify the year too this will work

Not applicable

Hi,

Nirbav post is correct that will gives you output as expected, but small change in it i.e; to avoid present month data

=Sum({< CalDate={'>=$(=MonthStart(Max( {<CalYear=, CalMonth= , CalMonthYear=, CalQuarter=>} CalDate), -3))<=$(=MonthEnd(Max( {<CalYear=, CalMonth= , CalMonthYear=, CalQuarter=>} CalDate),-1))'} , CalMonth=,CalQuarter=,CalYear= , CalMonthYear= >} Sales)

Best of luck