2 Replies Latest reply: Oct 10, 2017 8:46 AM by naveen kumar

# same expression in two different charts but getting totals different

Hello All,

kindly suggest me what i am missing in my expression please

i have a straight table chart with

3-   Dimensions: p_Material

VENDOR CODE

CATEGORY DESCRIPTION1

1- Expression:

sum(aggr(Avg({<BVALIDFROM={"<\$(=Date(yearstart(today(),0,4),'DD-MM-YYYY'))"},BVALIDTO={">\$(=Date(yearstart(today(),0,4),'DD-MM-YYYY'))"}>}distinct BPrice)*sum(VOLUME),p_Material,[VENDOR CODE]))

what i am doing is avg  of BPrice * sum of Volume  group by p_Material,Vendor code.......

the  Total i am getting is :33478046

when i tried to implement the same in bar chart with

1- Dimension :  CATEGORY DESCRIPTION1

1- Expression(Same):

sum(aggr(Avg({<BVALIDFROM={"<\$(=Date(yearstart(today(),0,4),'DD-MM-YYYY'))"},BVALIDTO={">\$(=Date(yearstart(today(),0,4),'DD-MM-YYYY'))"}>}distinct BPrice)*sum(VOLUME),p_Material,[VENDOR CODE]))

then Total i am getting is :3470522589.32

Even thought i am using the same expression and same dimension i am getting two different total .Is that because of aggregation?

• ###### Re: same expression in two different charts but getting totals different

naveen kumar wrote:

Even thought i am using the same expression and same dimension i am getting two different total .Is that because of aggregation?

You are not using the same chart dimensions.

Note that in first case, your chart dimensions are probably more granular than the aggr() dimensions, so you are running into

Pitfalls of the Aggr function

(DISTINCTNESS of aggr() returned values)