Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
eclecticfish
Contributor
Contributor

using a dynamic label in qlik Sense

Hi im having trouble getting a dynamic lable to work in a qliksense app.

I want to name a lable based on two selections.

first is an id and second is a value stateing the type of field. the id is selected from a box while the field_name is the one which will change and can be many different values.

 

below is the metatable containing the lable names. field_desc is the lable name and field_name is the type. and ctrl_id is the id. 

eclecticfish_0-1618923850752.png

I try using code like =If(GetFieldSelections(field_name) = 'T_AMT', field_desc) but the lable turn out as - instead of "TAP CHARED MIN" 

Labels (3)
5 Replies
tm_burgers
Creator III
Creator III

I think I have approached something similar with the below formula:

 

=If(GetFieldSelections(field_name) = 'T_AMT', concat(distinct field_desc))

eclecticfish
Contributor
Contributor
Author

thanks for the suggestion, unfortunately it didnt work for this problem. the problem is because there is two values available with the selection both the value of R_AMT and T_AMT. 

If the problem was in SQL i need what would translate to select field_desc where field_name = 'T_AMT' and ctrl_id = Selectedvalue() if that makes sense.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

If there is a selection in both ctrl_id and field_name, can your expression just be:

=field_desc

-Rob

eclecticfish
Contributor
Contributor
Author

field_name needs to be unselected, since in the chart different dimensions will need different names so a chart will at the same time show one dimension with like in the picture field_name t_amt and another with field_name r_amt and then another name. the idea is for field_desc to change value dependend on the selected id (ctrl_id)

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

I think I understand now.  You want

Only({<field_name{'T_AMT'}>}field_desc)

-Rob