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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cumulative Ratio

Hi

I just want to find the best way to answer this issue.

Suppose I have a file with

- MonthName (Jan12, Feb12, ...)

- A   a numeric field

- B   a numeric field

I want to display in line chart, the evolution of the Ratio = A/B  with accumulation

So for example,  in june my ratio  should be    sum( A)  from Jan to June /  sum(B)  from Jan to June

Usually I create a calendar which allow me to compare the monthname in the calendar with the monthname in the data.

It works but i'm sure is the solution.

Any idea ?

JJ

5 Replies
vgutkovsky
Master II
Master II

How about something like the attached?

Regards,

Vlad

Not applicable
Author

Hi Vlad

Not exactly, because I don't want to display the numerator and the denominator, but just the cumulative ratio.

If I use

rangesum( sum(A),above(sum(A)) ) /  rangesum(sum(B),above(sum(B)))

The calculation gives only the ratio for the current & previous rows.

Maybe someyhing with noofrow()

JJ

vgutkovsky
Master II
Master II

And your object cannot be a straight table (where expressions can be hidden)? Or a graphical chart (where expressions can be set to "Invisible")?

Vlad

Not applicable
Author

Not really

Finally, if find a good way with

=rangesum( above(sum(A) , 0 , noofrows() ) )  

/

rangesum( above(sum(B) , 0 , noofrows() ) )

Thanks anyway

JJ

vgutkovsky
Master II
Master II

I'm not sure what your function does, but glad you got it working.