Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SQL Load script - make currency negative based on flag

Hi im wondering what the sql code would be if i wanted to make a field negative (-) based on a flag. Because by default all values in the database are positive (+).

The conditions are if DRCR_FLG = -1 then the OSBASE_AMT should be negative, if DRCR_FLG = 1 then the OSBASE_AMT should be positive.

Currently my load script looks like the following:

-----------

TRANSACTIONS:
Load
DRCR_FLG,
OSBASE_AMT,
SQL SELECT * FROM ALI.TRX;

----------------

Regards

Jason

1 Solution

Accepted Solutions
Or
MVP
MVP

Try:

TRANSACTIONS:
Load
DRCR_FLG * OSBASE_AMT as OSBASE_AMT
SQL SELECT * FROM ALI.TRX;

View solution in original post

2 Replies
Or
MVP
MVP

Try:

TRANSACTIONS:
Load
DRCR_FLG * OSBASE_AMT as OSBASE_AMT
SQL SELECT * FROM ALI.TRX;

rotero
Creator
Creator

ihave the same concept of prob

instead of flag field

i use the code value of the field for determining

this is my prob

http://community.qlik.com/thread/34074