Skip to main content
Announcements
Qlik Community Office Hours, March 20th. Former Talend Community users, ask your questions live. SIGN UP
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using IF condition in Text box

Hello friends,

I need your help in what seem to be easy and straightforward yet i am not able to do it. I am trying to create a text box which how name of the market when i select an agent.

for this i am doing

='Market: ' & Market

and the outcome is something like Market: Alabama. Now  the problem is if the agent has multiple markets the filed goes Blank

I tired using

=if(Market>1, 'Multiple Markets', Market)

But nothing works. Please help me out with this.

I really appreciate all your help and support.

Thank you,

Syed.

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Try aggregation functions:

='Market: ' & Concat(DISTINCT Market,', ')

or

=If(Count(DISTINCT Market)>1,'Multiple', Only(Market) )

View solution in original post

6 Replies
swuehl
MVP
MVP

Try aggregation functions:

='Market: ' & Concat(DISTINCT Market,', ')

or

=If(Count(DISTINCT Market)>1,'Multiple', Only(Market) )

maxgro
MVP
MVP

for this i am doing

='Market: ' & Market

and the outcome is something like Market: Alabama. Now  the problem is if the agent has multiple markets the filed goes Blank

your expression is

='Market' & only(Market)

The Only Function

this is the reason you get a blank

You should use in that case an aggregation function, it could be

concat (or concat distinct) to get all the markets

maxstring, minstring 

Not applicable
Author

Thank you for the Explanation ..it really helped

Not applicable
Author

Thank you  ...Concat did what i wanted with it. But while i was working this out i ran into another issue. I have a list box that shows all the agents in all the region. I want this list box to be filtered to all the agents from a specific region the selected agent is from.

For example, if my selected agent belongs to region 1, then i want to show all the other agents that belong to region 1 in the list box. I have no idea how to go about with this. Please help me.

Thank you,

Syed.

swuehl
MVP
MVP

syed quadri wrote:

Thank you  ...Concat did what i wanted with it. But while i was working this out i ran into another issue. I have a list box that shows all the agents in all the region. I want this list box to be filtered to all the agents from a specific region the selected agent is from.

For example, if my selected agent belongs to region 1, then i want to show all the other agents that belong to region 1 in the list box. I have no idea how to go about with this. Please help me.

Thank you,

Syed.

Try a field <expression> in your list box like

=Aggr( Only({<Agent=, Region = p()>} Agent), Agent)

sravanthialuval
Creator
Creator

Try this:

Using getfieldselections() you will get all market names.

='Market' & '-' &GetFieldSelections(Market)

img.png