Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
upaliwije
Creator II
Creator II

Master Calender

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

1 Solution

Accepted Solutions
Anonymous
Not applicable

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;

View solution in original post

4 Replies
tresesco
MVP
MVP

SubField(POLICY_PERIOD, '-',2)+2000 & '-' SubField(POLICY_PERIOD, '-',4)+2000 AS policy_year

sunny_talwar

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

];

Anonymous
Not applicable

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;

d_koti24
Creator II
Creator II

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; !