Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
guillaume_gorli
Creator II
Creator II

Modify variable in script

Dear all,

I have a database coming from a ERP with below data :

Date

Order

Part Number

Codification of the order (either P for W)

Commercial Code of the part number

Sales


The basic output of data is as below :


Capture.JPG

P or W is linked to the order. So for instance sales of part number A is spit between Sales P and Sales W (30+24 = 54)

Now i would like to set things up so that commercial code X3 is always consider as Sales W, meaning "Codification of the order"  is always the data shown in field "codification of the order" except if field "Commercial code of the part number" equal "X3" when then "Codification of the order " is always W (could be P or W in the first place).


So the final out put should be :


Capture.JPG

Attached is qvw and xls test database for the ones who want to help

Thanks in advance

Guillaume

1 Solution

Accepted Solutions
antoniotiman
Master III
Master III

May be in script

LOAD Date,
Order,
[Part Number],
If( [Commercial Code of the part number] ='X3','W',[Codification of the order]) as [Codification of the order],

[Commercial Code of the part number],
Sales
FROM

(ooxml, embedded labels, table is Feuil1);

View solution in original post

5 Replies
Anil_Babu_Samineni

PFA

Capture.PNG

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
guillaume_gorli
Creator II
Creator II
Author

Thanks Anil.

The output is correct although i would prefer to go to a set up directly in the script instead of keying a "if conditio"n in each table of the report i have to issue (i have a lot tables to handle).

antoniotiman
Master III
Master III

May be in script

LOAD Date,
Order,
[Part Number],
If( [Commercial Code of the part number] ='X3','W',[Codification of the order]) as [Codification of the order],

[Commercial Code of the part number],
Sales
FROM

(ooxml, embedded labels, table is Feuil1);

guillaume_gorli
Creator II
Creator II
Author

Antonio, it works perfect !

Thanks a lot

Anil_Babu_Samineni

I apologies, I haven't read headline of your thread. Anyway thanks

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful