Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Data load

Dear Legends,

May I please get a little help on the scenario given below;

Tab1:

ITEMNO
CustsQTYTotal
1X1130
2Y250
3Z250

Tab2: (Same Items assigned to different values as Labels and no sales total in this table)

ITEMNO
Labels
1A
2B
3C

What do I want to achieve is;

Tab3:

AllCustsQTYTotal
X1130
Y250
Z250
A3100
B3100

I shall appreciate the precious time you could put on it.

Kind Regards,

Aamir

5 Replies
Not applicable
Author

Can you please paste your load query?

jagan
Partner - Champion III
Partner - Champion III


Hi,

On what basis the Qty and Total is assigned to A and B, if you just want 100 then simply use this

Tab1:

LOAD

*

FROM Tab1;

Tab2:

LOAD *

FROM Tab2

Tab3:

NoConcatenate

LOAD

*

RESIDENT Tab1;

Concatenate(Tab3)

LOAD

*, 

     3 AS QTY,

     100 AS Total

RESIDENT Tab2;

If you dont want Tab1 and Tab2 just drop it by using DROP TABLES Tab1, Tab2;

Hope this helps you.

Regards,

Jagan.

Not applicable
Author

Hi Anju,

Please find the load query below but I am sure it is not the right way to do it.

TAB1:

LOAD CUSTS,

    *ITEM as ITEMNO,

    Sale;

SQL CUSTS,

    ITEM,

    Sale

FROM LH.dbo."TAB1";

Tab2:

LOAD BRAND,

    COLOUR,

    DESIGN,

    *ITEMNO,

    LABEL;

SQL SELECT BRAND,

    COLOUR,

    DESIGN,

    ITEMNO,

    LABEL,

   

FROM LH.dbo."tab2";

ADD LOAD ITEMNO as ITEMS,

    LABEL as E_LABEL,

   

    if (wildmatch(LABEL, 'EXCO'), 'EXCO',

   

    if (WildMatch(LABEL,'*COMMERCIAL*'),'COMERCIAL','OTHERS')) as *CUSTS;

SQL SELECT ITEMNO,

    LABEL

FROM LH.dbo."TAB2";

Not applicable
Author

Hi,

You can add this under Tab2:

'LABEL AS CUSTS'

Next, for table 3, Create a pivot table with custs as dimension and add the other values under expression.

But, how are you calculating qty and total for customers A,B and C?

Not applicable
Author

Hi Aamir,

Jagan is right, if you want only 3 as QTY and 100 as Total for Cust A,B, then this will solve your purpose.

ResultTable:

LOAD

ITEMNO,

Custs as AllCusts,

QTY,

Total

FROM Tab1;

CONCATENATE

LOAD

ITEMNO,

Labels as AllCusts,

3 as QTY,

100 as Total

FROM Tab2

Hope this is helpful.

Thanks

Syed Haji