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

Add/Subtract in load script

Hi guys,

I have to make a hard coded correction in our loading script to get proper values in a certain situation.

Now I've written the following script where Document No_ 1234 has a value of circa -200.000:

Concatenate(Table)

LOAD

  "Document No_" as [Invoice Number],

  num(date(42735, 'DD-MM-YYYY')) as %key_Date,

   Amount * -1 as [Nett Amount],

  (Amount * -1) + num(10000) as [Nett Amount new],

   99999 as [%keyBill-to-Customer],

    1 as [Currency Factor],

    'Actual' as [Scenario]

FROM [my location]

(qvd)

WHERE MATCH([Document No_], '1234');

The Amount is a given value retrieved from a database (-200.000 in this case) and a positive correction of 10.000 should be made by a simple sum. When I have a look at the result of the sum to get the Nett Amount new, the result is 40.000 where it should be -190.000.

I'm obviously making a foolish mistake, but it would be great if you guys could explain how to do such an easy sum in the loading script.

Cheers,

Mike

2 Replies
shraddha_g
Partner - Master III
Partner - Master III

If possible share sample data

Anonymous
Not applicable
Author

I was trying to create some sample data, but I'm not sure of such a file will make it any clearer.

Unfortunately I'm not able to share the original data. How could I make the question a little bit more clear?

In the end I just want to add/substract a number from a given field value.