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: 
Not applicable

change axis scale according format number

Hi everybody,

i use in only one expression a IF to test which variable i display (that was a client request to do so and not to use group expression)

something like

dimension product

expression if(selection=1, sum(CA), sum(CA)/sum(Total CA)

the first format number is integer and the second is %

the problem is i can use only 1 format number for the expression in properties sheet "number"

even using num format wa can change display in the chart but the scale stays always the same

would you know how i could format the scale according the number i display?

best regards

christian

2 Replies
prieper
Master II
Master II

Hi,

in a textbox, would suggest to use the below:

if(selection=1, num(sum(CA), '#,##0'), num(sum(CA)/sum(Total CA), '#,##0%')

HTH

Peter

Not applicable
Author

I've been able to get around this problem by using variables to define my expressions. I plan to submit a paper on this soon, but here is a brief explanation to solve your immediate problem:

Define 2 variables:

e_1 = num(sum(CA),'#,##0')

e_2 = num(sum(CA)/sum(TOTAL CA),'##0%')

Then define your expression to resolve the input variable (selection):

$(=$('e_' & selection))

The inner expansion will create the proper name of the variable, based on the user selection in the input box. Then the outer expansion will resolve the expression assigned to that variable.

Of course, use Expression Default on the Number tab.

(I hope I got the syntax correct - if this does not work, let me know and I can fix it for you)

-Phil