Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Bob71
Contributor
Contributor

Consolidate rows

Hello everyone,

I'm using the load statement

LOAD id, tel

FROM table1;

I need that table1

idTel
11100
12200
13300
24400
25500
36600
47700
48800
49900

 

turning in table2

idtel1tel2tel3
1110022003300
244005500 
36600  
4770088009900

 

How can achieve that?

Thanks in advance

 

 

Labels (3)
2 Solutions

Accepted Solutions
marcus_sommer

I think this will be helpful: The-Generic-Load

- Marcus

View solution in original post

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I would do something like this:

tmp:
LOAD id,
Tel,
'Tel' & Autonumber(RowNo(), id) as number
FROM
[https://community.qlik.com/t5/New-to-QlikView/Consolidate-rows/m-p/1593418#M376678]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);

 

The results in Pivot table:

Screenshot_1.jpg

View solution in original post

7 Replies
marcus_sommer

I think this will be helpful: The-Generic-Load

- Marcus

sunny_talwar

Are you looking to do this in script?

Bob71
Contributor
Contributor
Author

Yes, if it is possible

Bob71
Contributor
Contributor
Author

Thanks, I'm going to read the article

saar_lorena
Contributor III
Contributor III

HI, try this:

 

Base:
LOAD * INLINE [
id, Tel
1, 1100
1, 2200
1, 3300
2, 4400
2, 5500
3, 6600
4, 7700
4, 8800
4, 9900
];

Reg_By_Id:
Load id, Count(Tel) as Counters, Concat(Tel, '|') as TelS Resident Base Group by id;


Max_Counter:
Load max(Counters) as maxTels Resident Reg_By_Id;

let vMaxTels = peek('maxTels',-1);

Base_Multiple_Tels:
load id, SubField(TelS,'|',1) as Tel1 Resident Reg_By_Id;


for i = 1 to $(vMaxTels)

left join(Base_Multiple_Tels)
load id, SubField(TelS,'|',$(i)) as Tel$(i) Resident Reg_By_Id;

next;

MindaugasBacius
Partner - Specialist III
Partner - Specialist III

I would do something like this:

tmp:
LOAD id,
Tel,
'Tel' & Autonumber(RowNo(), id) as number
FROM
[https://community.qlik.com/t5/New-to-QlikView/Consolidate-rows/m-p/1593418#M376678]
(html, utf8, UserAgent is 'Mozilla/5.0', embedded labels, table is @1);

 

The results in Pivot table:

Screenshot_1.jpg

Bob71
Contributor
Contributor
Author

In combination with the instructions in Generic Load, I've found the solution.

Thanks to all!