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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
amien
Specialist
Specialist

exclude records from list


LOAD *
FROM [1.CSV] (ansi, txt, delimiter is ';', no labels, msq)
WHERE @6 <> 'X1' AND @6 <> 'X2' AND @6 <> 'X3'
;


i need to add a lot of @6 values .. can i put them in a inline .. and then excluded them? how can i do this?

1 Solution

Accepted Solutions
Not applicable

Hello Amien

You can do this by creating an inline table of @6 values that should be included, or @6 values that should not be included,


ExcludeValues:
LOAD * INLINE
[ @6Exclude
X1
X2
X3];
YourTableName:
LOAD *
FROM [1.CSV] (ansi, txt, delimiter is ';', no labels, msq)
WHERE NOT Exists(@6Exclude, @6);


You could also do it the other way around by creating an inline table of values to INCLUDE, and the only change there would be that you should remove the word NOT from the WHERE clause in your final load statement.

Good luck,

View solution in original post

4 Replies
Not applicable

Hello Amien

You can do this by creating an inline table of @6 values that should be included, or @6 values that should not be included,


ExcludeValues:
LOAD * INLINE
[ @6Exclude
X1
X2
X3];
YourTableName:
LOAD *
FROM [1.CSV] (ansi, txt, delimiter is ';', no labels, msq)
WHERE NOT Exists(@6Exclude, @6);


You could also do it the other way around by creating an inline table of values to INCLUDE, and the only change there would be that you should remove the word NOT from the WHERE clause in your final load statement.

Good luck,

amien
Specialist
Specialist
Author

great solution .. works..

is it also possible to use this one in an expression? 'exists' doenst exists as function.

and how can i not get the found value as return .. but another value from the inline?

<pre>
[ @6Exclude, @6Exclude2X1, Test
X2, Test
X3, Test];



so .. the expression shouldnt return true or false .. but the value Test..

(mind that these are two different question) ..

Not applicable

Hi

For the expression I would use INDEX which is similar to FINDSTR, CHARINDEX etc, something like:

Index(GetFieldSelections("ColName"),'Dim1')


The above expression will give you a return number > 0 if Dim1 has been selected in the field ColName, equally, you could put anything else instead of GetFieldSelections("ColName") in this expression.

I'm afraid I don't understand you second question, where are you wanting to show the value "Test" is this in the load script (and therefore into a table) or is it in a chart?

amien
Specialist
Specialist
Author

Thanks