Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Friends
In my data table I have following dates
RISK_DATE |
01-Jan-15 |
02-Jan-16 |
12-May-15 |
13-May-16 |
10-Aug-17 |
11-Aug-15 |
13-Aug-16 |
14-Aug-15 |
17-Aug-15 |
18-Aug-17 |
23-Oct-15 |
24-Oct-16 |
27-Oct-17 |
In my load script I want to create 3 periods
1st RISK&MONTH<='14-AUG'
2nd RISK&MONTH>='15-AUG' and RISK&MONTH<='30-OCT'
3rd RISK&MONTH<='30-OCT'
Pls help me to write this in data load script so that I will have 3 dimensions for periods
1st RISK&MONTH<='14-AUG'
2nd RISK&MONTH>='15-AUG' and RISK&MONTH<='30-OCT'
3rd RISK&MONTH<='30-OCT'
Try this?
Period:
LOAD *,
IF(Period2 <= '14-Aug', '1st',
IF(Period2 >= '15-Aug' AND Period2 <= '30-Oct', '2nd')) AS PeriodStatus;
LOAD *, Date(Date#(RISK_DATE, 'DD-MMM-YY'), 'DD-MMM') AS Period2 INLINE [
RISK_DATE
01-Jan-15
02-Jan-16
12-May-15
13-May-16
10-Aug-17
11-Aug-15
13-Aug-16
14-Aug-15
17-Aug-15
18-Aug-17
23-Oct-15
24-Oct-16
27-Oct-17
];
Concatenate
LOAD RISK_DATE, Period2, IF(Period2 <= '30-Oct', '3rd') AS PeriodStatus
Resident Period;
I could not see Period 3rd when i used Mohammed script. Did the requirement changed? Just wondering to know!
Hi,
In The Sample Data, all the RISK_DATES are less than 30-Oct,
So that is the reason no RISK_DATES under period 3rd.
That is what he mentioned his 3rd Period should be between 1st Jan and 30 Oct.
His previous reply
My 3rd 3rd Period is all date between 1st-Jan to 30th Oct
So got confused. Cool thanks.
Requirement did not change. But I got total 1st+2nd as 3rd Period