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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Calculation - Resident Table

Hi there,

I am new to qlikview and am struggling to get this working. I wonder if anyone can help with this (Thanks in advance):

I have a table_A [amount, description, category1] and another table_B [category1, status1, status2] from two different sources, using a join load in script (category1 will be the key), I can merge them in table_A [amount, description, category1, status1, status2];

Then I wish to want new variables based on the values of status1 and status2:

eg:

New1 and New2

if(Status1='X', Amount) as New1;

if(Status2='Q', Amount) as New2;

The end result should be something like this:

AmountDescriptionCategory1Status1Status2New1New2
100AXQ100-
125BXR125125
40CYR-40

These is the script I used, but it produces a lot of duplicates, please advice!

Table_A:

LOAD Amount,

     Description,

     Category1

FROM

(ooxml, embedded labels, table is Sheet1);

Join (Table_A)

LOAD Category1,

     Status1,

     Status2

FROM

(ooxml, embedded labels, table is Sheet2);

Load

if(Status1='X', Amount) as New1,

if(Status2='Q', Amount) as New2

Resident Table_A;

Labels (1)
10 Replies
Not applicable
Author

Yes, thank you again for the solution and the explanation. Knowing this would be very helpful.

Cheers,

William