Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi , is there any way to give "IF" condition in Qlikview edit expression.
if( Amount>= 0, 'OK', 'Alarm' )
Can you elaborate little more please?
something like this
if(A=1 or B=1,1,0)
Regards
ASHFAQ
See example
Load Customers,Sales,
if( Sales >= 15000, 'Above 15000', 'Less Than 15000' ) as SalesFlag
Load * inline
[
Customers,Sales
A,15474
B,10000
C,20000
D,45000
E,15000
];
----------------------------------------------------
Or in the load script other ways you can use it
if a=1 then
load * from abc.csv;
sql select e, f, g from tab1;
end if
if a=1 then; drop table xyz; end if;
if x>0 then
load * from pos.csv;
elseif x<0 then
load * from neg.csv;
else
load * from zero.txt;
end if
ok but if have three or more condition in that columns what should we do in that case ?? if( Amount>= 0, 'OK', 'Alarm' )
Like this
if( Amount= 0 Or Amount= 100 Or Amount= 200, 'OK', 'Alarm' )
Then go with nested if.
Regards
ASHFAQ
I guess, nested if is what you mean. The syntax is like:
=If( Amount>=0, 'Positive' , If( Amount< -100, 'Less than minus 100' , 'In Between zero and -100'))
Other way with Pick() & Match() is like:
=Pick(Match(Amount, 1,2,3,4), 'One', 'two', 'Three', 'Four')
Then you can use If else if with multiple conditions
if condition1 then
[ statements ]
{
elseif condition2 then
[ statements ] }
[ else
[ statements ] ]
end if