Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Everyone,
Here I Want to implement looping concept in qlikview but I'm not able to implement the same,
please anyone help me how we can implement loop .
The requirement is as below -
In this table I_Key and L_Key are primary key by using these primary key I want to calculate according to each ItemID to different location Qty should be 5.
ItemID | I_Key | LocationID | L_Key | Qty |
---|---|---|---|---|
I1 | 1 | L1 | 1 | 5 |
I2 | 2 | L2 | 2 | |
I3 | 3 | L3 | 3 | |
I4 | 4 | L4 | 4 | |
I5 | 5 | L5 | 5 | |
I6 | 6 | L6 | 6 | |
I7 | 7 | L7 | 7 | |
I8 | 8 | L8 | 8 | |
I9 | 9 | L9 | 9 | |
I10 | 10 | L10 | 10 | |
L11 | 11 | |||
L12 | 12 | |||
L13 | 13 | |||
L14 | 14 | |||
L15 | 15 | |||
L16 | 16 | |||
L17 | 17 | |||
L18 | 18 | |||
L19 | 19 | |||
L20 | 20 |
after implementing the loop concept the output should be as below- For each ItemID for 20 different location Qty should be 5.
l
ItemID | I_Key | LocationID | L_Key | Qty |
---|---|---|---|---|
I1 | 1 | L1 | 1 | 5 |
I1 | 1 | L2 | 1 | 5 |
I1 | 1 | L3 | 1 | 5 |
I1 | 1 | L4 | 1 | 5 |
I1 | 1 | L5 | 1 | 5 |
I1 | 1 | L6 | 1 | 5 |
I1 | 1 | L7 | 1 | 5 |
I1 | 1 | L8 | 1 | 5 |
I1 | 1 | L9 | 1 | 5 |
I1 | 1 | L10 | 1 | 5 |
I1 | 1 | L11 | 1 | 5 |
I1 | 1 | L12 | 1 | 5 |
I1 | 1 | L13 | 1 | 5 |
I1 | 1 | L14 | 1 | 5 |
I1 | 1 | L15 | 1 | 5 |
I1 | 1 | L16 | 1 | 5 |
I1 | 1 | L17 | 1 | 5 |
I1 | 1 | L18 | 1 | 5 |
I1 | 1 | L19 | 1 | 5 |
I1 | 1 | L20 | 1 | 5 |
Thanks .
Hi Tresco,
Thanks for the reply but I'm not able to implement the concept according to the requirement,
Can you please provide a demo according to the same.
Thanks
Have you gone through the page -12 ("Generating all combinations of several fields") of the pdf? That should help you. Otherwise, create a qvw with sample inline data and share.
Hi Tresco,
I am attaching qvw file with qvd data file .
Please implement the loop concept.
Thanks
PFA
You just need a simple outer join.
Don't get confused with table data in the front-end, it shows the unique combination only. Press Ctrl+T to go to table viewer, there you cn check the data in preview mode to understand the actual data.
Note frequency in the listbox as well for comprehension.
Hi Tresesco,
Thank you so much for the reply but that is not correct output.
in this we need to apply the loop without looping concept I think its not possible .
in this table we have 10 different Itemid and 20 different locationid .
I want to fix qty = 5 according to each itemid corresponding to each different locationid for example
itemid | locationid | qty |
1 | 1 | 5 |
1 | 2 | 5 |
1 | 3 | 5 |
1 | 4 | 5 |
1 | 5 | 5 |
1 | 6 | 5 |
1 | 7 | 5 |
1 | 8 | 5 |
1 | 9 | 5 |
1 | 10 | 5 |
1 | 11 | 5 |
1 | 12 | 5 |
1 | 13 | 5 |
1 | 14 | 5 |
1 | 15 | 5 |
1 | 16 | 5 |
1 | 17 | 5 |
1 | 18 | 5 |
1 | 19 | 5 |
1 | 20 | 5 |
2 | 1 | 5 |
2 | 2 | 5 |
2 | 3 | 5 |
2 | 4 | 5 |
2 | 5 | 5 |
2 | 6 | 5 |
2 | 7 | 5 |
2 | 8 | 5 |
2 | 9 | 5 |
2 | 10 | 5 |
2 | 11 | 5 |
2 | 12 | 5 |
2 | 13 | 5 |
2 | 14 | 5 |
2 | 15 | 5 |
2 | 16 | 5 |
2 | 17 | 5 |
2 | 18 | 5 |
2 | 19 | 5 |
2 | 20 | 5 |
as usually for itemid 1 to 10.
thanks
As I already mentioned, have you checked the preview of data?
yes I have check . The problem is that L_key is the primary key of LocationID and I_key is the primary key of itemid ,
so according to itemid and locationid it's primary key would be same .
I attach primary key only for applying the loop concept in data we have only locationid and itemid.
Thanks.
That you have to decide against your actual data. I just tried to give you an idea how can be done (trick is that outer join).