I have the following question, you might be able to support.
I load a table once a week in Qlik Sense including new data linked to that week. E.g.
Column 1 / Column 2
ValueA / CW02
ValueB / CW02
ValueA / CW03
ValueC / CW03
I want to add a new column "Column 3" when loading the data to identify if the value in "Column 1" has been already provided in a previous week or not. E.g.
Column 1 / Column 2 / Column 3
ValueA / CW02 / NEW
ValueB / CW02 / NEW
ValueA / CW03 / NOT NEW
ValueC / CW03 / NEW
As "ValueA" was already in the table in CW02, then when loading the data in CW03, it should be highlighted as NOT NEW in "Column 3" for CW03.
I appreciate if you could support with this. Thanks you in advance.
If I understood correctly , maye be :
Data: load *,if(Exists([Column 1]),'NOT NEW','NEW') as [Column 3] inline [ Column 1 / Column 2 ValueA / CW02 ValueB / CW02 ValueA / CW03 ValueC / CW03 ](delimiter is '/');
this script should help you
OldData: load *, if(Exists([Column 1]),'Old','New') as [Column 3]; load * inline [ Column 1,Column 2 ValueA,CW02 ValueB,CW02 ]; NewData: Load *, if(Exists([Column 1]),'Old','New') as [Column 3]; load * inline [ Column 1,Column 2 ValueA,CW03 ValueC,CW03 ];
I tried your suggestion and my problem is that the code identifies all lines as "Old"
The example I provided is a very simplyfied version of my problem. I will provide further details.
My Qlik Sense App is reading the data from an Excel file that it is weekly updated. Then I execute "Load data" and with this, old and new lines of this excel are re-loaded. The code would look like this:
FROM [lib://.../Weekly BFE discrepancy monitoring.xlsx]
(ooxml, embedded labels, table is [Weekly Report]);
My objective would be to compare the values in [Key] for the latest week with the content of [Key] for previous weeks and identify if they are "new" or "old".
Thank you in advance.
Hello Rubén ,
Can @lironbaram 's solution solve the problem?