Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
yelin_nyu
Creator
Creator

toggle between % and units

I created 2 buttons. one is in units, and another is for percentage. when i click on units, my charts should show units, when i click on %, it should show %. but I am unable to get % working. the num() only allow me use % or not

thanks

5 Replies
Anonymous
Not applicable

if it is chart use properies and go to number tab  and select the number format option avaiable

hope it helps

Thanks

sushil353
Master II
Master II

Hi,

Try this:

create a variable say vUnit

in the chart expression do something like:

=if(vUnit=1,num(Value/100,'##0%'),Value).

now just toggle the value of vUnit using your buttons

HTH

Sushil

yelin_nyu
Creator
Creator
Author

Yes, i did that but the problem is if i select integer or number, I get decimal points for %, if i use percentage in number tab, i get % for units. i tried to use num() function in expression, but couldn't over write the setting in Number tab.

yelin_nyu
Creator
Creator
Author

I just tried this. but couldn't get % sign to appear. it made my values 9.87, without % . shall i use num#()

yelin_nyu
Creator
Creator
Author

I fixed the problem by using default expression from number  so when i use num() to format the expression, it will work.