Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
renjithpl
Specialist
Specialist

Sales between months

Hi All,

I want to show sales for last 12 months from the current month, i dont have day wise sales instead montly, i have it from 2006,

i used this formula in a straight table

but it shows sales from 2006,

My Current Selection is Year = 2012 and Month = Nov

 

sum({<MONTH_NAME={">=$(=MonthName(AddMonths(max(MONTH_NAME), -12)))<=$(=MonthName(max(MONTH_NAME)))"}, MONTH_NAME=, Month=, YEAR=, Year=>} Sales)

regards

4 Replies
Not applicable

What is the structure of ur MONTH_NAME field?

Like below or not.

Dec 2011

Dec 2012

~Kabilan K

nirav_bhimani
Partner - Specialist
Partner - Specialist

Hi,

try this

sum  ({ <InvoiceDate =   P(  { <InvoiceDate ={">=$(=(Max(InvoiceDate)-365) ) <= {<CalendarYear={$(=max(CalendarYear))},CalendarMonthName={$(=Month(Max(InvoiceDate)))}>}"}>} ) >} InTotRs)

Regards,

Nirav Bhimani

renjithpl
Specialist
Specialist
Author

Hi Kapilan you are right.

Not applicable

So, this expression wont work ryt?

AddMonths(max(MONTH_NAME), -12)

So, u can write a script like this

=sum

({<MONTH_NAME={">=$(=MonthName(AddMonths(makedate(Right(max(MONTH_NAME),4),match(left(max(MONTH_NAME),3),'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov,'Dec' )), -12)))<=$(=MonthName(max(MONTH_NAME)))"}, MONTH_NAME=, Month=, YEAR=, Year=>} Sales)

I didn't check this.

just, I assume this.

~kabilan K.