Skip to main content

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
NEW webinar Dec. 7th: 2023 Outlook, A Pivotal Year for Data Integration SIGN ME UP!
cancel
Showing results for 
Search instead for 
Did you mean: 
gowtham2074
Contributor
Contributor

Filtering on Conditions.

Hello all,

I have data something like this

gowtham2074_0-1658154921706.png

and want to filter it in such a way that i need to get all records that contain either a or b in col1 and col2. Resulting in 

gowtham2074_1-1658154994995.png

can you let me know how do i add a filter to do the above.

 

Thank you,

Sai.

 

@sunny_talwar 

Labels (1)
4 Replies
edwin
Master
Master

if you can add  a measure, add in the set analysis:  {<col1={'a','b'}>+<col2={'a','b'}>}

which means include rows where col1 is ab or col2 is ab

edited - added closing brackets

sidhiq91
Specialist
Specialist

@gowtham2074  Please use the below Script in the back end. Also I have attached the output screen shot.

NoConcatenate
Temp:
Load * Inline [
Col1, Col2
a,b
c,c
d,b
];


NoConcatenate
Temp1:
Load *
Resident Temp
where Match(Col1,'a','b') or Match(Col2,'a','b');

Drop table Temp;

Exit Script;

If this resolves your issue, please like and accept it as a solution.

 

Leonardo12
Contributor II
Contributor II

Test:
Load * inline
[
Col1,Col2
a,b
c,c
d,b
]
where Col1 = 'a' or Col1 = 'b' or Col2 = 'a' or Col2 = 'b'
;
Exit Script;

mark6505
Partner - Master
Partner - Master

Hi Similar,

To the above I would flag it in script if possible.

Something like

Load

Col1,

Col2,

IF( Col1 = 'a' or Col1 = 'b' or Col2 = 'a' or Col2 = 'b', 1,0) as Flag

From Table;