Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
mahendragaur
Creator
Creator

Repeat Data

Hello Team,

I have raw data like shown below -  

NameValue1Rep1Value2Rep2
A10552
B206103
C342543

 

Expected Result-

There should be multiple line based on Rep1 and Rep2

like 10 should be repeated 5 times for A and 5 should be repeated 2 times

that means there will be 7 rows for "A" which have 5 rows for 10 and 2 rows for 5.

Output Table-

 

NameValues
A10
A10
A10
A10
A10
A5
A5
B20
B20
B20
B20
B20
B20
B10
B10
B10
C34
C34
C54
C54
C54

Please let me know how i can implement this at script level.

2 Replies
tresesco
MVP
MVP

May be like this:

t1:

Load * Inline [

Name, Value1, Rep1, Value2, Rep2

A, 10, 5, 5, 2

B, 20, 6, 10, 3

C, 34, 2, 54, 3];

t2:

Load Name, Value1 as Value

Resident t1 While IterNo()<=Rep1;

Load Name, Value2 as Value

Resident t1 While IterNo()<=Rep2;

Drop table t1;

Anil_Babu_Samineni

You need to copy 2 times like one for Value1 and one more for Value2 and then you need to resident using Where condition for IterNo() <= Each represent..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful