Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello Team,
I have raw data like shown below -
Name | Value1 | Rep1 | Value2 | Rep2 |
A | 10 | 5 | 5 | 2 |
B | 20 | 6 | 10 | 3 |
C | 34 | 2 | 54 | 3 |
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-
Name | Values |
A | 10 |
A | 10 |
A | 10 |
A | 10 |
A | 10 |
A | 5 |
A | 5 |
B | 20 |
B | 20 |
B | 20 |
B | 20 |
B | 20 |
B | 20 |
B | 10 |
B | 10 |
B | 10 |
C | 34 |
C | 34 |
C | 54 |
C | 54 |
C | 54 |
Please let me know how i can implement this at script level.
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;
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..