Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
salto
Specialist II
Specialist II

Table transformation

Hello Community!

I have a table like this:

RowFormula
BS0500BS0510
BS0500BS0520
BS0510240
BS0510249
BS0510293
BS0520242
BS0520295

And I would like to convert / expand it to this:

Header 1Header 2
BS0500240
BS0500249
BS0500293
BS0500242
BS0500295
BS0510240
BS0510249
BS0510293
BS0520242
BS0520295

Any help would be highly appreciated!

Thanks in advance.

1 Solution

Accepted Solutions
Not applicable

Hi, you can try this in the script -

HTH!

tab:

load * Inline [

_Row, Formula

BS0500, BS0510

BS0500, BS0520

BS0510, 240

BS0510, 249

BS0510, 293

BS0520, 242

BS0520, 295

];

Tmp:

load _Row, Formula as _F

resident tab;

left join

load

_Row as _F, Formula

Resident tab;

drop table tab;

Fnl:

load _Row as Row,

  if(isnull(Formula), _F, Formula) as Formula

resident Tmp;

drop table Tmp;

View solution in original post

2 Replies
Not applicable

Hi, you can try this in the script -

HTH!

tab:

load * Inline [

_Row, Formula

BS0500, BS0510

BS0500, BS0520

BS0510, 240

BS0510, 249

BS0510, 293

BS0520, 242

BS0520, 295

];

Tmp:

load _Row, Formula as _F

resident tab;

left join

load

_Row as _F, Formula

Resident tab;

drop table tab;

Fnl:

load _Row as Row,

  if(isnull(Formula), _F, Formula) as Formula

resident Tmp;

drop table Tmp;

salto
Specialist II
Specialist II
Author

Thanks a lot Patrick!