Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
inigoelv
Creator
Creator

Problem Operation with Variables

Hi;

I have a problem with the calcul of two variables in a chart:

V1= Sum({<Linea={"1"}, Codes={"*"}-{"1","20","24","31"}>} Quantity)/60

V2=Count (distinct {<Linea={"1"},Codes={"*"}>}Clave)-Sum ({<Linea={"1"},Codes={"1","20","24","31"}>} Quantity/60)/480

When I calcul in one expresion in a chart:

$((V1)/($(V2)*480)

the memory is exceded in the chart.

The problem is the operation with 480.

When I take out 480, the expression calcul something.

I am interested to make work the expression.

Please, one solution...

6 Replies
sunny_talwar

May be remove this parenthesis -> $((V1)/($(V2)*480)

$(V1)/($(V2)*480)

inigoelv
Creator
Creator
Author

Sorry, it does not work.

marcus_sommer

Do you mean with it doesn't work that the result isn't like you expected it or that you yet get an error-messages? I think you should be more explicit by declaring the variables to ensure that your calculations happens in the right order. I mean something like this:

V1:

(Sum({<Linea={"1"}, Codes={"*"}-{"1","20","24","31"}>} Quantity)/60)

V2:

(Count (distinct {<Linea={"1"},Codes={"*"}>}Clave)-(Sum ({<Linea={"1"},Codes={"1","20","24","31"}>} Quantity/60)/480))

and then use these variable-calculations within a table-chart without an expression-name so that you could see within the expression-label how the variables will be evaluated (in cases of memory exceeded reduce the dataset by removing dimensions and selecting to a quite granular level).

- Marcus

inigoelv
Creator
Creator
Author

Hi Marcus:

Sorry for the not clear message.

At the end the solution was other:

1/480 *$(V1)/($(V2)

I don´t know why if I insert the value at the beginning of the expresion it works.

Best regards,

Peter_Cammaert
Partner - Champion III
Partner - Champion III

If V2 contains an expression that divides by 480, and in your final expression you multiply by 480, can't you just leave out the division/multiplication?

sunny_talwar