Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
please help to get the following,
For 31 days : date from 17th to 31st Oct'20 to be considered only.
For 30 days months : Date from 16th to 30th to be considered.
for February : in leap year 15th to 29th, while in non-leap year 14th to 28th to be considered.
Please help me to get this or if any link is there by which I can get help.
Thank you in advance
Hi all,
Anyone can help me it this.
Try like below
LET vDMNoOfYear =6;
LET vMaxDate = Num(Today()-1);
LET vMinDate = Num(YearStart(AddYears(Today(), -($(vDMNoOfYear)))));
Load *,
If(Month(CalDate)='Feb',
If(mod(Year(CalDate),4) = 0 and mod(Year(CalDate),100) <> 0 or mod(Year(CalDate),400) = 0,
if(Day(CalDate)>14,1), If(Day(CalDate)>13,1)),
if(Match(Month(CalDate), 'Jan', 'Mar', 'May', 'Jul', 'Aug', 'Oct', 'Dec'),
If(Day(CalDate)>16,1),
If(Day(CalDate)>15, 1))) as Flag,
Year(CalDate) as Year,
Day(CalDate) as Day,
Month(CalDate) as Month;
LOAD
Date($(vMinDate) + IterNo()-1) as CalDate
AutoGenerate 1
While $(vMinDate) + IterNo()-1 <= $(vMaxDate);
Select Flag and verify the values.. You can use flag in ur set analysis.
Or instead of Flag, u can create another date field also.
Its depends on ur requirements.