Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

true or false

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

11 Replies
sunny_talwar

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

];


Capture.PNG

Colin-Albert

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

Logical Operators

All logical operators interpret the operands logically and return true (-1) or false (0) as result.

  

notLogical inverse. One of the few unary operators. The operation returns the logical inverse of the operand.
andLogical and. The operation returns the logical and of the operands.
orLogical or. The operation returns the logical or of the operands.
XorLogical exclusive or. The operation returns the logical exclusive or of the operands. I.e. like logical or, but with the difference that the result is false if both operands are true.
datagrrl
Creator III
Creator III

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.

raadwiptec
Creator II
Creator II
Author

HI SUNNY,

IN EXPRESSION? IS IT POSSIBLE

effinty2112
Master
Master

This should do it:

Column A Column B if([Column A] ='False' and [Column B] = 'False', 'False','True')
FalseFalseFalse
FalseTrueTrue
TrueFalseTrue
TrueTrueTrue
sunny_talwar

Try this as your expression:

If(Upper([column A])&'|'&Upper([Column B]) = 'FALSE|FALSE', 'False', 'True')

eduardo_sommer
Partner - Specialist
Partner - Specialist

In fact it's OR instead of AND

AND is True Only when both are True

Eduardo

raadwiptec
Creator II
Creator II
Author

HI All,

Thanks. All the answers are correct. I choose one . I will mark it as correct answer.

thanks

Colin-Albert

Oops! Its a long time since I looked at ANDs ORs and XORs 🙂