Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

how can I split a field into two?

LOAD

GEO&'.'&[Operating Area]&'.'&[Sales_Region]&'.'&Territory&'|'&upper(ACCOUNT_SEGMENT)&'|'&[NCV_Type]&'.'&[Hyperion Budget Unit]&'.'&SCBU&'|'&left(Fiscal_Period,4)&'-Q'&Right(Fiscal_Period,1)

as [~MasterKey],

Pipe,

'PNCV' AS [NCV_Type]

FROm

(ooxml, embedded labels, table is Data);

this is the code , but the fiscal period is in the image below,

fiscal.PNG

  • i want this to be like 2016 as Fiscal Year and 1 as Q1, Q2,.. as Fiscal quarter.
  • I want this to be scripted in the script above in the master key.
  • But the data which I am getting it only has Fiscal period column, I want to split it as fiscal year and fiscal quarter and add that into the master key script.
  • How can this be achieved?
  • Thanks in advance.
1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Load

...

Left(Fiscal_Period, 4) as fiscal_year,

Right(Fiscal_Period, 1) as Fiscal_Quarter,

....

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Load

...

Left(Fiscal_Period, 4) as fiscal_year,

Right(Fiscal_Period, 1) as Fiscal_Quarter,

....

sunny_talwar

You can split it like this in the script:

Left(Fiscal_Period, 4) as FiscalYear,

Right(Fiscal_Period, 1) as FiscalQuarter

avinashelite

try like this:

LOAD

subfield(Fiscal_period,' ',1) as Fiscal_Year,

'Q'&subfield(Fiscal_period,' ',2) as Fiscal_Quater

from

table ;

Anonymous
Not applicable
Author

I assume that you want 'Q' in fiscal quarter, so

'Q' & right(Fiscal_Period, 1) as Fiscal_Quarter,

alexandros17
Partner - Champion III
Partner - Champion III

My answer was even correct ...