Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
soha1902
Creator
Creator

Data

Done

9 Replies
saurabhwadhwa
Partner - Contributor III
Partner - Contributor III

Hi Soha,

Try this in expression.

Sum({<Date = {">=$(=Date(addmonths(Max(Date), -3))( <=$(=Date(Max(Date)))"} >} Sales)



Thanks

arulsettu
Master III
Master III

first format your date field

Date(Date#(Date,'YYYYMMDD'),'DD/MM/YYYY') as datefield,

year(datefield) as year,

month(datefield) as month


and post the excel file

robert_mika
Master III
Master III

Try like this

Table:

LOAD [Accounting Date] as Date,

     [41000 Amount] as Amount

           

FROM

C:\Users\js46089\Desktop\data.xls

(biff, embedded labels, table is Sheet1$)

     where Date(Date#([Accounting Date],'YYYYMMDD'),'DD/MM/YYYY')>=AddMonths( Date(Date#(Date,'YYYYMMDD'),'DD/MM/YYYY'),-3)

sujeetsingh
Master III
Master III

You can achieve this  with multiple ways. Well for UI just use Dimension Limits

SreeniJD
Specialist
Specialist

As Arul suggested, first you have to change your date format...

=Date(Date#(Date,'YYYYMMDD'),'MMM YYYY') as MonthYear

and then use the below expression for previous 3 months amount

Last 3 Months

Sum({<Year=, Quarter=, Month=, Week=, Date={‘>=$(=MonthStart(Max(datefield), -2))<=$(=Date(Max(datefield)))’}>} Amount )

HTH

Sreeni

soha1902
Creator
Creator
Author

Not Working

Anonymous
Not applicable

Try This..

Sum({<Date={‘>=$(=MonthStart(Max(datefield), -3))<$(=MonthStart(Max(datefield)))’}>} Amount )

Not applicable

Script:

 

Date:

LOAD date,
MonthName( date) as MM_YYY,
sale
FROM
date.xlsx
(
ooxml, embedded labels, table is Sheet1);

Variables:

vDate1 =date(floor(AddMonths( date,-1)))

vDate2 =date(floor(AddMonths( date,-3)))

Filter Column:

Date

Pivot Chart:

Dimension

MM_YYY

expression

Sum ({<date={'<=$(vDate1)>=$(vDate2)'}>}sale)

Not applicable

Hi

try to load Monthname(Date) which will give you the month name & year like this Capture.PNG

then you can restrict the last three month in the expression using variables.