Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
Not applicable

Accumulate for the numerator, but regular for denominator

How can I take the accumulation of one number and divide it by another number that is not accumulated?

Month     Sold     Inventory

Jan          5          10

Feb          4          20

Mar          6          15

April          3          15

So i wand to take the the Acculmated Inventory of of 60and divide it by the the April sold of 3 to get 20

Thanks in Advance

1 Solution

Accepted Solutions
filosofo
Contributor

Re: Accumulate for the numerator, but regular for denominator

Hi, you can add an expression with the formula: Rangesum(Above(Inventory, 0, RowNo())) and then a fourth expression with the formula: Column(3)/Sold.

Regards, Sander

6 Replies
filosofo
Contributor

Re: Accumulate for the numerator, but regular for denominator

Hi, you can add an expression with the formula: Rangesum(Above(Inventory, 0, RowNo())) and then a fourth expression with the formula: Column(3)/Sold.

Regards, Sander

Not applicable

Re: Accumulate for the numerator, but regular for denominator

Thanks!!! That worked great!

Not applicable

Re: Accumulate for the numerator, but regular for denominator

Hi Sander/James,

Can i get the complete script for this sample. How do you create a tablebox with the addditional columns for Calculations achieved. Please post the script used for acheiving it(I have only personal edition).

Thanks in Advance

Sri

filosofo
Contributor

Re: Accumulate for the numerator, but regular for denominator

Hi, create a straight table (not tablebox) with Month as dim and the others as expressions. Script is nothing more than an inline table.

Test:

LOAD * INLINE [

Month, Sold, Inventory

Jan, 5, 10

Feb, 4, 20

Mar, 6, 15

Apr, 3, 15

];

Regards, Sander

Not applicable

Re: Accumulate for the numerator, but regular for denominator

Image.pngThanks Sanders,

One last question, how to remove the first row in the result which is not much useful. Attached the image.

Thanks,

Sri

filosofo
Contributor

Re: Accumulate for the numerator, but regular for denominator

Hi, on the expressions tab switch the total mode to no totals for each expression. Regards.

Community Browser