Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Period

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

16 Replies
upaliwije
Creator II
Creator II
Author

1st  RISK&MONTH<='14-AUG'

2nd RISK&MONTH>='15-AUG' and RISK&MONTH<='30-OCT'

3rd RISK&MONTH<='30-OCT'

vishsaggi
Champion III
Champion III

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;

HirisH_V7
Master
Master

Hi upaliwije

Did you try above

-Hirish

HirisH
“Aspire to Inspire before we Expire!”
vishsaggi
Champion III
Champion III

I could not see Period 3rd when i used Mohammed script. Did the requirement changed? Just wondering to know!

mdmukramali
Specialist III
Specialist III

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.

vishsaggi
Champion III
Champion III

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.

upaliwije
Creator II
Creator II
Author

Requirement did not change. But I got total 1st+2nd as 3rd Period