Skip to main content
Announcements
Intermittent issues logging into the Qlik Community. We are working toward a resolution.
cancel
Showing results for 
Search instead for 
Did you mean: 
shahafei2
Creator
Creator

LOAD AND JOIN DATA ACCORDING TO FOR LOOP

Hi all,

 

I've two tables  that I would like to join by using for loop

the key attribute is "GROUP"

and the for loop should be based on the value in "SKUs" attribute

 

the expected result is to join a"factor" from "Factors" table to each "SKU" in "MD" table by as many SKUs as defiend in "SKUs" attribute according to "Group"

 

The tabels are:

 

MD:
Load SKU,
Description,
Group

from [items.xlsx]

(ooxml, embedded labels, table is Sheet1);

 

Factors:

Load Group,

            Factor,

            SKUs

From

[Factors.xlsx]

(ooxml, embedded labels, table is Sheet1);

 

What will be the best way to implement it?

 

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I'm not sure why you are proposing a for loop. You can join using multiple fields. From your description it sounds like a single join would do it:

Left Join(MD)
Load Group,
            Factor,
            SKUs as SKU
From [Factors.xlsx]
(ooxml, embedded labels, table is Sheet1);

-Rob

shahafei2
Creator
Creator
Author

I'm sorry if it is unclear from the description 

but the SKUs attribute represents the number of SKUs that the factor is relevant for 

 

for example, the result for the inline tables below should be :

result:

Load * Inline [

SKU,Description,Group,Factor

A,AAA,22,1.5

B,BBB,22,1.5

C,CCC,22,3

];

 

MD:

Load * Inline [

SKU,Description,Group

A,AAA,22

B,BBB,22

C,CCC,22

];

Factors:

Load * Inline [

Group,Factor,SKUs

22,1.5,2

22,3,1

]