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

List box restriction

Hi ,

Can we restrict the value in list box? Such as we just want to show the name with prefix L and hide the other name.

Many thanks and thanks in advance!

br,

Lisen

Labels (1)
7 Replies
jagan
Partner - Champion III
Partner - Champion III

Hi,

Try this expression in list box

=Aggr(If(Name LIKE 'L*', Name), Name)

Regards,

Jagan.

robert_mika
MVP
MVP

Hi jagan

Why do we have the Aggr function as a first argument here?

Not applicable
Author

Hi Jagan

thanks for your help~

one more question~ can i use this expression to restrict the list with the value of another field? such as show the provinces which belongs to China and UK, and there are two fields: province and country.

thanks in advance!

br,

lisen

jagan
Partner - Champion III
Partner - Champion III

Hi Robert,

We can also do the same without using aggr() like below,  sometimes we will get issues without aggr() that is why I mentioned Aggr().  Aggr() is something like a loop.

=If(PREF_NAME LIKE 'S*', PREF_NAME)

Regards,

Jagan.

ashfaq_haseeb
Champion III
Champion III

Hi

You can event try other way around

=If(Name LIKE 'L*',Aggr(Name, Name))

Regards

ASHFAQ

jagan
Partner - Champion III
Partner - Champion III

Hi,

Try like this

=If((Country = 'UK' OR Country='China'), Province)

Regards,

Jagan.

MarcoWedel
MVP
MVP

or maybe

Aggr(Only({$<name={"L*"}>} name), name)

regards

Marco