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

dynamic label?

HI All,

I have list box  name flag having, Prim & Sec..

I select Prim in List box Straight table Label should come as Prim.

I select Sec in List box Straight table Label should come as Sec

Regards,

Helen

1 Solution

Accepted Solutions
avinashelite

Try like this

if(trim(Getfieldselections(flag))='Prim','Sales',if(trim(Getfieldselections(flag))='Sec','PriSales','Default_Msg'))

View solution in original post

10 Replies
amit_saini
Master III
Master III

Hi,

See the attachment.

Thanks,

AS

Not applicable
Author

Try something like this :

if (getfieldselections(flag)='Prim','Prim','Sec') in Title of the chart.

Regards,

Balakrishnan.R

nagarjuna_kotha
Partner - Specialist II
Partner - Specialist II

Hi

Like this :

We have two ways achieving this :

1. Normal Field in Label Like "=Field"

2.Using GetFieldSelections

See attached.

Hope this may help.

Regards,

Nagarjun !

avinashelite

Add this expression in the chart label

Getfieldselections(flag)

Not applicable
Author

With in the Flag what ever  i will match, i need to show that Name..

Example: Flag =Prim, then i need show label name as Sales

               Flag =Sec, then i need show label name as PriSales

Regards,

Helen

adamdavi3s
Master
Master

use = pick(match(flag,Prim,Sec),'Sales','PriSales')

Sorry I might have the syntax a little off but it should be close

avinashelite

Try like this

if(trim(Getfieldselections(flag))='Prim','Sales',if(trim(Getfieldselections(flag))='Sec','PriSales','Default_Msg'))

adamdavi3s
Master
Master

I'm interested to discuss but I would always use pick(match( over IF statements where possible, IF statements are really inefficient....

this is the correct formula: =pick(match(flag,'Prim','Sec'),'Sales','PriSales')

avinashelite

with limited values both would perform the same(i.e with the current scenario we have only 2 values), with the large data comparison I would prefer using the Pick and match combination ..hope this make sense