Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
In my QV document I have following field amongst others
POLICY_PERIOD
Jan-15-Jan-16
Feb-13-Feb-14
Apr-14-Apr-15
I want this field to joined to Master Calender and extract the undermetioned field
policy_year
2015-2016
2013-2014
2014-2015
Pls help me to write script for master calender
You Can try something like this:
MasterCalender:
load
POLICY_PERIOD,
'20'&mid(POLICY_PERIOD,5,2)&'-'&'20'&mid(POLICY_PERIOD,12,2) as YEAR
Resident TableName;
SubField(POLICY_PERIOD, '-',2)+2000 & '-' SubField(POLICY_PERIOD, '-',4)+2000 AS policy_year
May be something like this in the script:
Fact:
LOAD *,
Left(Replace(Replace(KeepChar(POLICY_PERIOD, '0123456789-'), '--', '20'), '-', '20'), 4) & '-' &
Right(Replace(Replace(KeepChar(POLICY_PERIOD, '0123456789-'), '--', '20'), '-', '20'), 4) as policy_year;
LOAD * Inline [
POLICY_PERIOD
Jan-15-Jan-16
Feb-13-Feb-14
Apr-14-Apr-15
];
MasterCalendar:
LOAD * Inline [
policy_year
2015-2016
2013-2014
2014-2015
];
You Can try something like this:
MasterCalender:
load
POLICY_PERIOD,
'20'&mid(POLICY_PERIOD,5,2)&'-'&'20'&mid(POLICY_PERIOD,12,2) as YEAR
Resident TableName;
Hi ,
period:
LOAD * Inline [
POLICY_PERIOD
Jan-15-Jan-16
Feb-13-Feb-14
Apr-14-Apr-15
];
master:
load
POLICY_PERIOD,
20&''&SubField(POLICY_PERIOD,'-',2)&'-'&20&''&SubField(POLICY_PERIOD,'-',-1) as POLICY_PERIOD
Resident period; !