Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Un concatenation data

I have input records in excel like this and wanted to achieve output as shown in below. INPUT: COUNTRY YEAR US 2005|2006|2007|2008 UK 1990|1991|1992|1993 OUTPUT: COUNTRY YEAR US 2005 US 2006 US 2007 US 2008 UK 1990 UK 1991 UK 1992 UK 1993 Looks like easy, but not able to get the correct formula. Can you pls assist me. Thanks,

11 Replies
MarcoWedel

Please close this thread if your problem is solved.

thanks

regards

Marco

preminqlik
Specialist II
Specialist II

LOAD COUNTRY,

  subfield(trim(PurgeChar(STR_NEW,'~~')),'|',1) as Year,

  subfield(trim(PurgeChar(STR_NEW,'~~')),'|',2) as Brand,

  subfield(trim(PurgeChar(STR_NEW,'~~')),'|',3) as Model,

  subfield(trim(PurgeChar(STR_NEW,'~~')),'|',4) as Condition,

  subfield(trim(PurgeChar(STR_NEW,'~~')),'|',5) as Delivered

  where len(STR_NEW)>0;

LOAD *,subfield(STR,'~~') as STR_NEW INLINE [

    COUNTRY, STR

    US, ~~2005|SONY|MOD1|WORKING PIECE|YES ~~2006|SONY|MOD2|DAMAGE|NO ~~2007|SONY|MOD3|WORKING PIECE|NO

    UK, ~~1999|SAMSUNG|GALAZY|DAMAGE|NO~~2000|SAMSUNG|GALAZY S4|WORKING PIECE|NO~~2001|SAMSUNG|GALAZY S5|DAMAGE|YES

];