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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
rsdhavle
Creator III
Creator III

Selecting based on two region fields

I have two fields RegionA and RegionB. I want to introduce a new field which will have logic like.

RegionA = 'ASIA' or RegionB ='ASIA' ..I want this logic in new field lets say named RegionC. How can I write it in a generic way?

Labels (1)
4 Replies
ashfaq_haseeb
Champion III
Champion III

Hi,

May be like this

load *,if(RegionA=RegionA,RegionA) as Region;

LOAD * Inline

[

RegionA,RegionB

Asia,Africa

Africa,Asia

Asia,Asia

];

Regards

ASHFAQ

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

You can use alternate states to do this. You can find an example here: Using Alternate States to Select Multiple Values in a List Box with Different Attributes.


talk is cheap, supply exceeds demand
rsdhavle
Creator III
Creator III
Author

So in my case do I need to compare each and every value From RegionB with Region A like below?

if(FindOneOf('ASIA',RegionB) > 0, RegionA) as RegionC,

rsdhavle
Creator III
Creator III
Author

In my case its not working I think. In my case If RegionA is Asia , RegionB can contain different values and vice versa.

And i need to show Combination when RegionA = Asia OR RegionB = Asia