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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
gerhardl
Creator II
Creator II

Load certain values as negatives

Hi,

How would I go about loading the values of certain fields as negative, IF another field meets certain criteria?

I have the following 2 fields - [Transaction Amount] and [Transaction Code].

Certain transactions are purchase reversals, so if I load them as negative numbers it is easier for me to show the Turnover (I can just sum the totals).

My statment must be:

Load [Tran Amount] as negative value IF [Tran Code] = 36 or 931.

Thanks,

G

1 Solution

Accepted Solutions
deepakk
Partner - Specialist III
Partner - Specialist III

hi,

If (code = 454 or code =400 , Amount*-1, Amount) as Amount.

I hope this helps.

View solution in original post

1 Reply
deepakk
Partner - Specialist III
Partner - Specialist III

hi,

If (code = 454 or code =400 , Amount*-1, Amount) as Amount.

I hope this helps.