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: 
Anonymous
Not applicable

How can I exclude a value from a string?

Hi,

I'm using a Concat function for a certain task:

Concat(DISTINCT Media, ', '). This function returns a set of currently selected media. E.g. TV, Press, Radio.

My task is to exclude a certain value on a certain condition.

I'll give an example:

- Let's say there's a condition which is regulated by Var_A. If Var_A=1, then I want TV to be excluded from the output of the concat function.

- Imagine that all three media have been selected by the user via a listbox: TV, Press, Radio. I can not clear a user-defined selection.

- But if Var_A=1, then I need to exclude TV from the output of the Concat function, though it is selected via a listbox at the moment.

In other words I need something like:

if Var_A=1 then fulfill Concat(DISTINCT Media, ', ') but exclude 'TV'

The underlined text is not QV-syntax.


Can I convert it to QV-syntax?

Thank you in advance,

Larisa

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Like this?

=Concat(DISTINCT If(Var_A <> 1 Or Media <> 'TV', Media), ', ')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Like this?

=Concat(DISTINCT If(Var_A <> 1 Or Media <> 'TV', Media), ', ')

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

Answer gone to moderation

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable
Author

Thank you!