# New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Not applicable

## 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

10 Replies
MVP

## 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.

Valued Contributor

## 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))

Not applicable

Thanks Sunny.

Not applicable

Thanks Fei Xu.

Not applicable

## 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))

MVP

## Re: While Multiplying Variables in Dimension & Measure

Try this:

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

Not applicable

## 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.

Not applicable