Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
kevbrown
Creator II
Creator II

Split a field then join

I have a field that consists of Sector-Company-Month-Year and i need to split it out to Sector, Company, MonthYear, so 3 new fields. I also want to create a 4th field which will be the 1st day of each MonthYear combination.

So far I have

Market_Terms:

LOAD

    %join_terms,

    Subfield (%join_terms, '-',1) AS Sector,

    Subfield (%join_terms, '-',2) AS Company,

    Subfield (%join_terms, '-',3) AS MonthYear

However MonthYear s just showing Month

13 Replies
kevbrown
Creator II
Creator II
Author

That works to an extent but shows -Jan-2016 and MonthYear is blank

Kushal_Chawda

try this

Market_Terms:

LOAD

    %join_terms,

    Subfield (%join_terms, '-',1) AS Sector,

    Subfield (%join_terms, '-',2) AS Company,

   mid(%join_terms,index(%join_terms,'-',2)+1) AS MonthYear,

    monthstart(date#(mid(%join_terms,index(%join_terms,'-',2)+1),'MMM-YYYY')) as FirstDayMonth

kevbrown
Creator II
Creator II
Author

perfect, thank you

Kushal_Chawda

welcome