Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hey Guys,
I am writing below logic so that when status is not equal to 3 or 4 it should display Unprocessed else Processed.
if ([statut] <>'3' or '4', 'Unprocessed', 'Processed') as Flag
But in qlikview after I write the above condition, I get Unprocessed if Status=3, which is wrong according to this above logic.
Can you please help me with the above issue?whether my calculation wrong?
Hi ,
Try this =if(wildmatch(status,'3','4')>=1,'Processed','Unprocessed')
May be this?
if ( Not Match ([statut], '3', '4'), 'Unprocessed', 'Processed') as Flag
Hi,
Check this whether it is useful
status:
LOAD * INLINE [
Status
1
2
3
4
5
6
7
8
9
];
load *,
if(Status = '3' or Status = '4', 'UnProcessed') as Flag
Resident status;
load *,
if(Status <> '3' or Status <> '4', 'Processed') as Flag
Resident status;
Try this,
if ([status] <>3 or [status]<>4, 'Unprocessed', 'Processed') as Flag
Try:
=if(Match(status,'3','4'),'Processed','Unprocessed')
hello
due to operator precedence, your formula is equivalent to
[statut] <>('3' or '4')
try with match function for example
Hi Olivier,
Olivier Robin wrote:
hello
due to operator precedence, your formula is equivalent to
[statut] <>('3' or '4')
try with match function for example
I guess that's not correct. In fact,
if ([statut] <>'3' or '4'
is being evaluated as: if ( ([statut] <>'3') or '4' ..........., i.e it is evaluating two separate conditions, one for [statut]<>'3' and second one just '4', which is actually TRUE always (any number except '0' is 'true'). Therefore, the condition effectively becomes : if ( ([statut] <>'3') or TRUE() , ... I.e. - 'something OR TRUE' - which would always return a TRUE.