5 Replies Latest reply: Aug 23, 2011 8:04 AM by Jairish Ramsanjhal

# Re-using numbers from one object into other objects

Dear Qlikview experts,

I have a straight table in which I have made some calculations. For this I have set the total on

'sum of rows' in the expression tab. I would like to use this number

in another chart for further calculations but when doing this with a macro

it doesn't work out as the macro uses the 'expression total' when the total is calculated.

 ID Price Amount Gross 3.041 € 333.754 A1 € 215,40 179 € 38.557 A2 € 447,80 107 € 47.915 A4 € 109,10 11 € 1.200 A5 € 92,40 2.454 € 226.750 A7 € 173,10 19 € 3.289 A8 € 98,50 45 € 4.433 A11 € 51,30 220 € 11.286 A14 € 54,30 6 € 326

I would like to divide € 333.754/179 (of A1) but in another chart. How can I use the values to be incorporated in other charts? Any thoughts are highly appreciated.

Regards,

Rishi

• ###### Re: Re-using numbers from one object into other objects

Hi Rishi,

There is no functionality in Qlikview to use the one object data in to another object but Qlikview would allow you copy the expression from one chart to another chart. You should have arrived at this 333.754 with help of some expression.

You can use the same expression in to another char and you can do the calculation.

But to get this 333.754, you need to use "Total" Modifier in you exprssion or Aggr() function.

For Example, Your expression to get 33.754 is  = Sum(Gross) in Object 1.

Now to use this 333.754 in other chart, you need to tweak your expression like  Sum(Total<ID> Gross).

Hope this helps you.

-Sridhar

• ###### Re-using numbers from one object into other objects

Dear Sridhar,

Thank you for your reply. The code you suggested is working only if you want to sum

something depending on a simple sum or count. However if you would like to calculate

something covering multiple dimensions this won't work.

What I would like to do is to mutiply Price*Amount for every ID and the total sum of this

as shown in the table (which is 333.754). Any thoughts on how to do this?

Regards,

Rishi

• ###### Re-using numbers from one object into other objects

create a variable for calculation and use the same where ever u want

• ###### Re: Re-using numbers from one object into other objects

Rishi,

you mean that, you dont have any aggregation function in your expression?

Aggr(sum(mutiply Price*Amount),ID)

or

sum(Total<ID> mutiply Price*Amount)

- Sridhar

• ###### Re-using numbers from one object into other objects

Sridhar,

Thanks for your feedback. I was almost there but you gave the last push in solving this issue. I fixed it with

sum(Total<ID> mutiply Price*Amount) where as in my first expression I didn't include the Amount.

Thank you very much Sridhar and have a good one!

Best Regards,

Rishi