Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
I have data of 20 period as 2013P01 format.
I have only one field yearperiod,,based on this how could i apply last 10 months data. whatever data come i always want to keep last 10 mnths data in my report. Could you please help me
Hi Kalyani,
You can use below script in where clause to achieve that. Here, I am converting yearperiod field which has "2013P01" format to "1/1/2013" date format.
Where Date(Date#(yearperiod, 'YYYYPMM'))>AddMonths(Today(), -10);
Hope it helps you
Satya
Hi Satyadev..thanks a lot for your response.
But I have tried with the above expression but it is not working.
While loading yearperiod I an restricting with thus expression,but not working for me,
Hi!
Try this. In your expression put:
Sum({<YEARPERIOD={">=$(=AddMonths(Today(), -10))<=$(=Date(Today(),'YYYYMM'))"}>} FIELD)
Hi Kalyani,
Are you getting any error? Could you share a sample app to understand more on this.
The above script first converting yearperiod which is in "2013P01" format to date format and extracting last 10 months data by comparing with addmonths(today(), -10).
Hi,
LOAD
*,
MakeDate(Left(MonthFieldName, 4), Right(MonthFieldName, 2)) AS DateFieldName
FROM DataSource;
Now use this expression
=sum({<MonthFieldName=, YearFieldName=, DateFieldName={'>=$(=MonthStart(Max(DateFieldName), -10))<=$(=Date(Max(DateFieldName)))'}>} MeasureName)
or
=sum({<MonthFieldName=, YearFieldName=, DateFieldName={'>=$(=MonthStart(Max(DateFieldName), -9))<=$(=Date(Max(DateFieldName)))'}>} MeasureName)
Regards,
Jagan.
hi guys thanx a lot,it works
Hi Kalyani,
Please close this thread by giving Correct and Useful Answers to the posts which are helpful to you, so that it would be helpful for others.
Regards,
Jagan.