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: 
Asuod_
Creator
Creator

Toggle Between Primary Keys Using Variables

Hello,

 

I have been tasked with creating a dashboard that allows users to toggle between two different unique IDs, using them as the primary key. By default, the dashboard loads with `ID_1`, but users should be able to switch to `ID_2` through a variable toggle.

 

My question is: how can I configure this variable and apply it in the visualizations? Should I use something like a `vPrimaryKey` variable as a measure, or is there a better approach to handle this requirement?

 

I would appreciate any guidance or alternative solutions. Thank you!

Labels (1)
1 Reply
rubenmarin

Hi, I'm not sure to follow but maybe you could use set analysis on the dashboard measures like:

Sum({<IDField={'$(vPrimaryKey)'}>} Value)

The bold part of set analysis should be in all the expression of the dasboard.

Or set a button with actions that: unlocks IDField, removes the selections on IDField, makes the new selections on IDField and locks it.