Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi experts,
Can anyone help me how to write if statement in load script. I try below script and get error.
If
Currency='USD' then
Sale*Exchange
Else Sale
End If as Sale,
Hi Sir,
This script is not correct in QlikView. Now let try:
[Data]:
LOAD
...
If(Currency='USD',Sale*Exchange,Sale) As [Sale],
...
Regards,
Sokkorn
Thanks bika_2010
Hi Sir,
This script is not correct in QlikView. Now let try:
[Data]:
LOAD
...
If(Currency='USD',Sale*Exchange,Sale) As [Sale],
...
Regards,
Sokkorn
Sokkorn, it work!!!. Can you help to explain me on your statement?
Hi,
If(Condition, then, else)
The three parameters condition, then and else are all expressions. The first one, condition, is interpreted logically. The two other ones, then and else, can be of any type. They should preferably be of the same type. If condition is true, the function returns the value of the expression then. If condition is false, the function returns the value of the expression else.
Example:
If(Amount>= 0,'OK','Alarm')
Regards,
Sokkorn
Load
If(Currency='USD',Sale*Exchange,Sale) As [Sale]
From Source table....
Thanks bika_2010
Thank you Sokkorn. Very nice