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

Loading amount values

Hi,

I'm trying to show Buy trades as a negative amount and Sell trades as a positive amount.

Presently our data shows an absolute value (EXTENDED_AMT).

Ideally I would like to create a new column in the load statement.

Any help with this will be much appreciated.

Regards,

Daniel


1 Solution

Accepted Solutions
marcus_sommer

Perhaps so: if(categorie = 'buy', value * -1, value)

- Marcus

View solution in original post

4 Replies
Anonymous
Not applicable

Hi,

Can you attach a sample data model so we can have a better understanding of your problem?

marcus_sommer

Perhaps so: if(categorie = 'buy', value * -1, value)

- Marcus

Gysbert_Wassenaar

Perhaps something like this:

TableX:

LOAD

    FieldX,

    FieldY,

    TradeType,

    EXTENDED_AMT

    if(TradeType='Sell', EXTENDED_AMT, -EXTENDED_AMT) as AMOUNT,

    ...other fields....

FROM ...somewhere...;


talk is cheap, supply exceeds demand
danielnevitt
Creator
Creator
Author

Thank you for the replies.

I used the If statement provided by Marcus in the end and it works perfectly.

Regards,

Daniel