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: 
slacayo
Contributor III
Contributor III

Detect string in a row for all columns

LOAD * INLINE [
  ID, c1,   c2,  c3,  c4,  .... cn
1, - , yes, no, -, -, -
2, - , yes, no, -, -, -
3, - , no, no, -, -, -
4, - , -, -, -, -, -
]; 

I want to add a column flag at the end of the the table if ANY of the cells for a row have 'yes' in them. So in this case, an extra column would look as follows 

1

1

0

1 Reply
maxgro
MVP
MVP

try with

 

LOAD
*,
-1 * (MATCH('yes', c1, c2, c3, c4, cn) > 0) as flag
;
LOAD * INLINE [
ID, c1, c2, c3, c4, cn
1, - , yes, no, -, -, -
2, - , yes, no, -, -, -
3, - , no, no, -, -, -
4, - , -, -, -, -, -
];