Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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:
Amount | Description | Category1 | Status1 | Status2 | New1 | New2 |
---|---|---|---|---|---|---|
100 | A | X | Q | 100 | - | |
125 | B | X | R | 125 | 125 | |
40 | C | Y | R | - | 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;
Yes, thank you again for the solution and the explanation. Knowing this would be very helpful.
Cheers,
William