Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
hi alli,
this is my scenario
column A ! Column B ! Final
False False False
False True True
True False True
True True True
I need suggestion to get final column
May be something like this:
If(Upper([column A])&'|'&Upper([Column B]) = 'FALSE|FALSE', 'False', 'True') as Final
SAMPLE:
Table:
LOAD *,
If(Upper([column A])&'|'&Upper([Column B]) = 'FALSE|FALSE', 'False', 'True') as Final;
LOAD * Inline [
column A, Column B
False, False
False, True
True, False
True, True
];
The final table is a Boolean AND of Column A and Column B.
If these fields hold correct True (-1) and False (0) values, then you can use columnA AND columnB
QlikView has the following Boolean operators
All logical operators interpret the operands logically and return true (-1) or false (0) as result.
I deleted my original reply instead of editing it to correct the case on my expression.
Is there a reason you would do this instead of
If(Upper([Column A])='FALSE' and Upper([Column A]) ='FALSE', 'False', 'True')
I know they both work. Is my way against the best practice, poor performing or just a different way of doing it?
I am mostly self taught, so I think a lot about whether my expressions are performance hogs. Any feedback is appreciated.
HI SUNNY,
IN EXPRESSION? IS IT POSSIBLE
This should do it:
Column A | Column B | if([Column A] ='False' and [Column B] = 'False', 'False','True') |
---|---|---|
False | False | False |
False | True | True |
True | False | True |
True | True | True |
Try this as your expression:
If(Upper([column A])&'|'&Upper([Column B]) = 'FALSE|FALSE', 'False', 'True')
In fact it's OR instead of AND
AND is True Only when both are True
Eduardo
HI All,
Thanks. All the answers are correct. I choose one . I will mark it as correct answer.
thanks
Oops! Its a long time since I looked at ANDs ORs and XORs 🙂