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

Last 12 months sales data

Hi

Want to display last 12 months sales data.

My columns are

yearmonth which is a number

Amount which a sales amount filed

So can you please guide me how to get the last 12 months data?

Please do the needful

Thir

12 Replies
Digvijay_Singh

If yearmonth is a seq no then you may use expression something like -

Sum({$<yearmonth = {“>=$(=Max(yearmonth ) – 11)<=$(=Max(yearmonth ))”}>} Amount )

Kushal_Chawda

try this expression

rangesum(above(Sum(Salesamount),0,12))

ecolomer
Master II
Master II

see this example

Kushal_Chawda

or see the below link using which you can do the same from script itself

Rolling N months

amit_saini
Master III
Master III

Hi,

Check

Thanks,

AS

Not applicable
Author

Hi

YearMonth is a time stamp and it is a num datattype

So please do the needful

Thiru

Not applicable
Author

Hi AS

It's not working

=Sum({<YearMonth={‘>=$(=MonthStart(Today(), -11))<=$(=Today())’}>}Amount)

showing error

and

=sum({<YearMonth={">$(=monthstart(max(YearMonth),-12))<$(=monthstart(max(YearMonth)))"}>}Amount)

It is showing 0

So

what i have to use exactly?

Not applicable
Author

Hi

It's not working

=Sum({<YearMonth={‘>=$(=MonthStart(Today(), -11))<=$(=Today())’}>}Amount)

showing error

and

=sum({<YearMonth={">$(=monthstart(max(YearMonth),-12))<$(=monthstart(max(YearMonth)))"}>}Amount)

It is showing 0

So

what i have to use exactly?