# QlikView App Development

Discussion Board for collaboration related to QlikView App Development. Not applicable

## Calculate using the Total of the straight table

Hi Community,

I want to perform calculations using the Totals of the records in the straight table.

Can we store the totals of the Straight table into variables and use for further calculations?

As shown in the attachment, I have four Total values using them i would like to calculate Adjustment%.

Please let me know in case you have any ideas to achieve the same.

Tags (1)
1 Solution

Accepted Solutions MVP

## Re: Calculate using the Total of the straight table

You can't access the results of a calculation in a chart from outside the chart (like accessing the values in a table chart cell directly), but you can replicate the expression of that chart column in an variable definition, like

vVar:

=Sum( Amount ) / Count(DISTINCT Month)

To get your variable definition correctly done, it would be helpful if you could post a small sample QVW.

3 Replies MVP

## Re: Calculate using the Total of the straight table

If you want to use these values in the total row for Adjustment% in the same chart, try using Column(2), Column(3), Column(4) and Column(5) to access the other expressions values (or reference the expression labels instead).

If you only need to do this in the total line, you can use Dimensionality() function to check if you are evaluating in the total line:

=If(Dimensionality()=0,

Column(2) + Column(3) + Column(4) +Column(5) // what ever you need to calculate

, YourOtherExpression

) Not applicable

## Re: Calculate using the Total of the straight table

Hi Stefan,

Is there a way i can store these total values in variables and perform the necessary calculations in other chart? MVP

## Re: Calculate using the Total of the straight table

You can't access the results of a calculation in a chart from outside the chart (like accessing the values in a table chart cell directly), but you can replicate the expression of that chart column in an variable definition, like

vVar:

=Sum( Amount ) / Count(DISTINCT Month)

To get your variable definition correctly done, it would be helpful if you could post a small sample QVW.