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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How can I delete a column based on a condition?

Hi,

Loading an Excel file, I have a column that, depending on the contents (or rather lack of), needs to be removed.

I can go the strange way of transposing the table (since in my case it's always the first column that's under the question) and deleting what is now the row. But I would like to know, in general, if I need to delete a column based on value(s) in it, how would I go about doing that?

Thank you,

Siarhei

1 Solution

Accepted Solutions
johnw
Champion III
Champion III

You can use DROP FIELD to actually remove a column completely after you've loaded it.  Wrap it in an IF block to conditionally drop the field.

If you just mean removing the value based on a condition:

if(condition, value) as value

Only in the given condition will value be filled in.  Otherwise the value in the column will be null.

View solution in original post

1 Reply
johnw
Champion III
Champion III

You can use DROP FIELD to actually remove a column completely after you've loaded it.  Wrap it in an IF block to conditionally drop the field.

If you just mean removing the value based on a condition:

if(condition, value) as value

Only in the given condition will value be filled in.  Otherwise the value in the column will be null.