Former Member

# Reg: Calculated variable in graph

Hi,

can you please suggest me how to use the calculated variable in graph. When I tried using the calculated variable the results that are provided is way bigger than the expected.

Formula used -

if 'A', 'B' and 'C' are my objects from the query in which A is a measure and B is a dimension then in the crystal report i am using sum(A)/Sum (A,B).

I have used Group expert and grouped the data by 'B', 'C'. The graph I am having will be displayed under the Group header of 'C'.

Regards,

Kiran

##### Add a comment
10|10000 characters needed characters exceeded

### Related questions

• Posted on Dec 06, 2013 at 04:37 PM

If you want the numbers for just the C group, I would change the formula to something like this:

Sum(A, C)/Sum(A, B)

"Sum(A)" gets you the grand total for the report, not the total for the group where you're putting the calculation.

-Dell

##### Add a comment
10|10000 characters needed characters exceeded
• Former Member Abhilash Kumar

Hi Abhilash,

I am having Metric 1 that gives me the numeric values splitted monthwise at Region and Country level.

Now I have created groups for Region and Country. Placed a two different graphs in group headers of region and country. These are having X-axis as Months and Y-axis with Metric 1 and a calculated variable. Below is calculation for calculated metric

Calculated variable = if drilldowngrouplevel = 0 then Sum(Metric1, Region)/sum(metric 1 , Region) else Sum(Metric1, country)/sum(metric 1 , Region)

When i used this variable in graph, values are not matching and its giving incorrect values. Please let me know if i am doing something wrong in creating variables

Regards,

Kiran