Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
IMPORTANT security patches for GeoAnalytics Server available to download: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
cchadda91
Contributor III
Contributor III

Defaut selection on button

PFA qvf file ...qliksense

So when I switch from one button to other (Primary button) , I want there should be default select on other set of button (Secondary buttons) which is currently not happening.

30 Replies
cchadda91
Contributor III
Contributor III
Author

Ishan,

Here bar chart title is dynamic in attached file.

So i wanted to do similar thing for dynamic chart title in the app you shared, but it wasnt working.

ishanbhatt
Creator II
Creator II

Yes, We can give the dynamic name of the chart.

For this, we've to give IF condition based on the variable.

Please find the attached app which contains the dynamic name. Please have a look and change the name according to your requirement.

Or Apart from this example, you can create one variable that reflects the name based on button selection.

Hope this helpful to you.

Thanks.

cchadda91
Contributor III
Contributor III
Author

Yes I tried this but it was showing error if indirectly reference the name using variable.

Get Outlook for iOS<https://aka.ms/o0ukef>

ishanbhatt
Creator II
Creator II

Please try the expression what I've used in the app (test - Solution with dynamic Title).

cchadda91
Contributor III
Contributor III
Author

Works Thanks Ishan, but what if we have two words in the field like code identifier in place of identifier just.

Here in app in the bar chart title it shows 'Top 3  [Code identifier] by long' since we are directly fetching the field name here any alternative if we want to show 'Top 3 code identifier by long' and remove these brackets in [Code identifier].

ishanbhatt
Creator II
Creator II

Yes, We can make one variable and based on button selection we can display the dynamic text.

Let's take an example.

vTitleText = 'Top 3' & if(vDimension =2 ,'Code Identifier', 'Portfolio')  & if(vMeasure = 1,'Long','Short')

Try above expression and change the Text according to variable selection.

Hope this helpful.

cchadda91
Contributor III
Contributor III
Author

Ishan ,

Thanks i got the point but the thing is that in the vMeasure and vDimension variable we are refrencing the field/ values itsef ( 'Portfolio' , 'code identifier', 'Short' , 'long') and now how can we make it dynamic using vMeasure=1 and vDimension=1 in the "if" condition expression you shared.

One thing could be i create 2 new variable vDimension1 and vMeasure1 and then play around with expression you shared.

Get Outlook for iOS<https://aka.ms/o0ukef>

ishanbhatt
Creator II
Creator II

Try this expression.

vTitle ='Top 3 '& if(vDimension='Portfolio','Portfolio','Code Identifire') & ' by ' & if(vMeasure='short','Short','Long')

cchadda91
Contributor III
Contributor III
Author

Yup it had worked for me.

Jus one thing in the if expression why arent we using $ sign like below, i cnt understand.

vTitle ='Top 3 '& if($(vDimension)='Portfolio','Portfolio','Code Identifire') & ' by ' & if($(vMeasure)='short','Short','Long')

Get Outlook for iOS<https://aka.ms/o0ukef>

ishanbhatt
Creator II
Creator II

For Detail explanation on $ sign go to below link.

Q-Tip #6 - Those Tricky $-Sign Expansions | Natural Synergies