Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Done
Hi Soha,
Try this in expression.
Sum({<Date = {">=$(=Date(addmonths(Max(Date), -3))( <=$(=Date(Max(Date)))"} >} Sales)
Thanks
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
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)
You can achieve this with multiple ways. Well for UI just use Dimension Limits
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
Not Working
Try This..
Sum({<Date={‘>=$(=MonthStart(Max(datefield), -3))<$(=MonthStart(Max(datefield)))’}>} Amount )
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)
Hi
try to load Monthname(Date) which will give you the month name & year like this
then you can restrict the last three month in the expression using variables.