Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I need suggestions from you.
I have a Date, Quarter columns.
Date with 2009 to 2014 Years, and Quarters respective (2009 Q1,Q2,Q3,Q4) to 2014( Q1,Q2,Q3,Q4)
now I need to optimize my application with only latest 10 Quarters i.e (2014 (4QUarters) + 2013(4Quarters) + 2012 (2 Qurters(Q3,Q4)Every time my app should load only latest 10 Quarters of Data.
suggest me on this
Attached file Query.xlsx has only 6 quarters
Hi John,
Your file is having only 6 quarters of data, please verify your file.
Regards,
Jagan.
Hi John,
It is very simple. Last 10 quarters actually means last 30 months. So, you can calculate 30 months back from today, than use this var in WHERE clause.
//Last 10 quarters = last 30 months:
LET vLastQuarters = MonthStart(AddMonths(Today(), -30));
Data:
LOAD CALENDAR_DATE,
Alt(Date(CALENDAR_DATE), Date(Date#(CALENDAR_DATE, 'DD/MM/YYYY'))) as Date, //some values are in DD/MM/YYYY format.
number_format,
QTR_CD,
YY_CD
FROM
Query.xlsx
(ooxml, embedded labels, table is Sheet1)
Where Alt(Date(CALENDAR_DATE), Date(Date#(CALENDAR_DATE, 'DD/MM/YYYY'))) >= $(#vLastQuarters);
Regards,
David