Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
rajni_batra
Specialist
Specialist

If Else Condition Fails

Hello Guys,

I have a scenario like i Have 2 Fields A and B

if(A<>B, 'Yes','No') but for some IDs both conditions are true but i want to display it as YES only if its falling in No also.

Labels (1)
6 Replies
Or
MVP
MVP

I don't follow. Either A <> B, or it isn't. How can both conditions be true? Perhaps you could post some sample data?

rajni_batra
Specialist
Specialist
Author

Here against One ID there 3 FBC's in Web but 1 FBC in NAV. i have used expression

Booking IDWeb FBCNAV FBC=1



1
NN251683034998EAP30EAP301
NN251683034998LE3MEAP301
NN251683034998SAP14EAP301
NN251683034998WE4MEAP301

=if([Nav FBC]<>[Web FBC],'FBC','NON FBC')

and OutPut is like below:

Booking IDWeb FBCNAV FBC=if([NAV ]<>[Web FBC] and Flag='Both' and Status='E','FBC','NON FBC')=1




1
NN251683034998EAP30EAP30NON FBC1
NN251683034998LE3MEAP30FBC1
NN251683034998SAP14EAP30FBC1
NN251683034998WE4MEAP30FBC1

Hope this will clear my problem

Regards,

rajni

christian77
Partner - Specialist
Partner - Specialist

Hi:

You may have double values in some cases. That means, for a value of A, you have 2 values on B, and one accomplishes the equality and the other one does not. The result is null.

Check that out.

rajni_batra
Specialist
Specialist
Author

Sorry But I couldn't Get you..

Not applicable

Hi Rajini,

post sample file with some data.. so, that it will be clear

Or
MVP
MVP

I'm still not really clear - what was the output you expected to see? What is incorrect with the output you posted?

If the idea is to have one line for each booking ID, and "True" if at least one case of Web FBC = NAV FBC exists, you could probably use something like:

If(sum(if([Web FBC] = [NAV FBC],1)>0,'True','False').

Which is to say - first, count the number of cases where Web = NAV and then if that number is greater than 0, show true. This should work in a chart where Booking ID is the dimension and this is an expression. If you need to use it in a dimension, you'd have to use aggr().