Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
dominicanlauf
Contributor III
Contributor III

Sum function under condition

Hello everybody,

i want to sum up all defective products in the production.  To determine that an order is defective, the description "CANCELED" must be assigned to the order number. If an error exists, a 1 is stored for this cause of the error. Then 1 is to be multiplied by the number of pieces produced.

My formula:

sum({<MPS_productionorderitem.state={CANCELED}>}(MPS_productionorderitem.axisdefect*(MPS_productionstatistic.ok)))

 

But it doesn't work. Does anybody has an idea?

 

best regards,

Dominic

Labels (2)
6 Replies
Frank_Hartmann
Master II
Master II

Maybe this:

 

sum({<MPS_productionorderitem.state={'CANCELED'}>}(MPS_productionorderitem.axisdefect*(MPS_productionstatistic.ok)))

dominicanlauf
Contributor III
Contributor III
Author

I thought the same but it does not work.

 

The formula only works if there isn't the condition MPS_productionorderitem.state={'CANCELED'}.

 

If the condition is active the result is always 0.

 

Do you have another idea?

Frank_Hartmann
Master II
Master II

not without looking into your qvw.

maybe you are able to scramble  (settings -> Docproperties -> Scrambling)  sensitive Fields and upload the qvw.

Or try to rebuild the issue with testdata and then upload the file!

 

dominicanlauf
Contributor III
Contributor III
Author

Maybe that will help.

 

thanks,

dominic

Frank_Hartmann
Master II
Master II

As far as i can see you are getting the 0´s in F_Axis column because the field MPS_productionorderitem.axisdefect is 0 for all  MPS_productionorderitem.state = CANCELED.  So if you multiply by 0 you will get 0 as result!

dominicanlauf
Contributor III
Contributor III
Author

That's right, currently no error cause is assigned a "1". Accordingly, the problem must already lie in the basic data.

 

Many Thanks

Dominic