Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Pivot Grid - Variables - Expression Bad Result

Hi! First of all, sorry for my english.

This is my app environment.

I'm using a Pivot Grid and the expression results came from Variables.

Variable 1: tBultosLiq<- sum(if(EstadoLiq='Liquidado',(MANIBultos)))

Variable 2: tPrecioFOB<- sum(if(LCPRECIOTipoLiqId=vLiquidacionTipoId , PrecioBulto*MANIBultos,0))/$(tBultosLiq)

Variable 3: tMontoFInal -> $(tBultosLiq) * $(tPrecioFOB)

I attached you an image with the Expressions Values (in red an example).

Expression 1: BtosLiq <- $(tBultosLiq) = 336 (this value is ok)

Expression 2: FOB MO <- $(tPrecioFOB) = 11,46 (this value is ok)

Expression 3: Monto Final <- $(tMontoFinal) = 6058.11 (this value is wrong). It must be = $3849 (336 * 11.46)


What i'm doing wrong?


Thanks


1 Solution

Accepted Solutions
swuehl
MVP
MVP

Shouldn't you enclose the complete sum of variables (tPrecioFOB) in brackets, so QV won't just multiply the first variable when expanding $(tBultosLiq) * $(tPrecioFOB) ?

i.e. try

Variable 3: tMontoFInal -> $(tBultosLiq) * ( $(tPrecioFOB) )

View solution in original post

4 Replies
swuehl
MVP
MVP

Could you show screenshots of the variable overview editor for each of the three variables?

Or post a sample QVW?

Not applicable
Author

Yes! I attach you an image per variable.

"tPrecioFOB" has a SUM of another Variables. I give you only an image of one of this variables because they are similar and the result of this is ok.

If i change the expression in the pivot grid it works, but i don't know why.

In Pivot Grid I change this: Monto Final = [FOB MO] * [BtosLiq] (instead of tMontoFinal). I'm using the other expressions instead of variable (but the formula is the same). I don't understand.

Thanks

swuehl
MVP
MVP

Shouldn't you enclose the complete sum of variables (tPrecioFOB) in brackets, so QV won't just multiply the first variable when expanding $(tBultosLiq) * $(tPrecioFOB) ?

i.e. try

Variable 3: tMontoFInal -> $(tBultosLiq) * ( $(tPrecioFOB) )

Not applicable
Author

It works! Thanks a lot!