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: 
stvn_003
Contributor III
Contributor III

Button to change units of measure / Boton para cambiar unidades de medida

Hello community, I have a board with several graphs and charts, and in the quantities I have a column of kilos, however, they asked me if I could add a button, or some object that, when pressed, converts the column of kilos into units, and vice versa.

Thank you in advance for all the help!

---

Hola comunidad, tengo un tablero con varios gráficos y cuadros, y en las cantidades tengo una columna de kilos, son embargo, me pidieron si se podría agregar un botón, o algún objeto que al presionarlo, la columna de kilos se convierta en unidades, y viceversa.

Desde ya agradezco toda la ayuda!

1 Reply
Marijn
Creator II
Creator II

You could make a button that changes a variable.Then use an if statement with this variable to convert your expression into the desired value.

For example, where vConvert is the variable you change with the button:

if($(vConvert)='units', convert kg's to units

if($(vConvert)='kg',show kg's))

 

Make sure you load vConvert with a value in the load script, otherwise you'll get an error in the chart when the button is not pressed. So put this is the load script:

let vConvert = 'kg'