11 Replies Latest reply: Oct 31, 2016 11:41 PM by Shazad Nazir

# While Multiplying Variables in Dimension & Measure

Dear Experts,

While multiplying variables in dimension i.e. \$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty it gives accurate result in Table chart.

Whereas if I i want to use the same expressions in measure of the same Table chart or in KPI (we have to use measure so the result is not correct) i.e. Sum(\$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty) the result is being multiplied by the factor of 9 or something.

what could be the reason for this wrong result, I also tried to Aggr but could not get the desired results.

Thanks & Regards

• ###### Re: While Multiplying Variables in Dimension & Measure

In an expression, the variables are determined based on the dimension. You might be able to do something like this

Sum(Aggr(\$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty, RowNumber))

Here RowNumber is created in the script using RecNo() as RowNumber for the fact table.

• ###### Re: While Multiplying Variables in Dimension & Measure

Thanks Sunny.

• ###### Re: While Multiplying Variables in Dimension & Measure

Thanks Fei Xu.

• ###### Re: While Multiplying Variables in Dimension & Measure

Hi Sunny,

I am trying to put condition in your recommended solution, it works fine but when i try to put condition in it {<FGCat = 'PM'>}. It does not work, can you please guide:

Sum({<FGCat = 'PM'>} (\$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty))

• ###### Re: While Multiplying Variables in Dimension & Measure

Try this:

Sum({<FGCat = 'PM'>} Aggr(\$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty, RowNumber))

• ###### Re: While Multiplying Variables in Dimension & Measure

Thanks for reply, I have tried that.

Sum({<FGCat = 'PM'>} Aggr(\$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty, RowNumber))

its not working. can you please suggest any other idea.

• ###### Re: While Multiplying Variables in Dimension & Measure

Sum({<FGCat = 'PM'>} Aggr(\$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty, RowNumber))

I tried but it didn't work.

• ###### Re: While Multiplying Variables in Dimension & Measure

Try

{<FGCat={PM}>}

• ###### Re: While Multiplying Variables in Dimension & Measure

Thanks, it didn't work either.

• ###### Re: While Multiplying Variables in Dimension & Measure

If \$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty is working in table chart by some dimension (Say the dimension is "Customer" for example), try this in the KPI measure:

=sum(aggr(\$(vFGCompPrice) * \$(vFGCompCurRate) * FGComponentQty, Customer))