Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

ratio with 2 expressions

Hello,

i have to do ratio/percentage to make a line on my combo-chart, like:

Div(Sum(X), Sum(Y))*100

but it doesn't work ...

Tks for your help

7 Replies
Not applicable
Author

round(Sum(X)/Sum(Y))*100

or

floor(Sum(X)/Sum(Y))*100

swuehl
MVP
MVP

div() is integer division (i.e. returns the integer part only), so your expression probably results in all zero?

Just use

=sum(X) / sum(Y)

and format as percentage in numbers tab.

Not applicable
Author

Doesn't work...

😞

swuehl
MVP
MVP

Would be good if you tell us a bit more what you have, get and expect.

Are X and Y fields? Do sum(X) and sum(Y) return values in the same context you use sum(X) / sum(Y)? What are these results?

Not applicable
Author

Post your qlik

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Just check whether Sum(Y) results zero then it doesn't produce value for that Sum(X).

Simply a divide by zero error.did you chk that?

Not applicable
Author

it's ok.

I done sum(x)/sum(Y) with all my selection in(X) and all my selection in (Y) but it's not very convenient....