Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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
Hi,
Can you attach a sample data model so we can have a better understanding of your problem?
Perhaps so: if(categorie = 'buy', value * -1, value)
- Marcus
Perhaps something like this:
TableX:
LOAD
FieldX,
FieldY,
TradeType,
EXTENDED_AMT
if(TradeType='Sell', EXTENDED_AMT, -EXTENDED_AMT) as AMOUNT,
...other fields....
FROM ...somewhere...;
Thank you for the replies.
I used the If statement provided by Marcus in the end and it works perfectly.
Regards,
Daniel