Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a field 'MeasureNo ' , 'MeasureValue' , 'WorkOrder'
in field 'MeasureNo' contains data '1' , '2', '3' ,'4', '5', ' Tank'
I only need MeasureValue where MeasureNo = 1,2,3,4,5
Now I tried the formula but the value is incorrect:
Sum({<MeasureNo={1}, MeasureNo={2}, MeasureNo={3},MeasureNo={4},MeasureNo={5} > } (Aggr(if(Max(MeasureValue) <= CuMax and Min(MeasureValue) >= CuIMin ,Count(WorkOrder)),WorkOrder)))
please try to explain what your are actually trying to calculate,
best using some sample data and your expected result.
I Count WorkOrder
where 'MeasureValue' between 'CuMax' and 'CuIMin'
At first I used this recipe. value came out correct :
Sum(Aggr(if(Max(MeasureValue) <= CuMax and Min(MeasureValue) >= CuMin ,Count(WorkOrder)),WorkOrder))
But the resulting value has field 'MeasureNo' containing data '1' , '2', '3' ,'4', '5', ' Tank'.
I need values where the 'MeasureNo' field contains only '1' , '2', '3' ,'4', '5' .
The value of 'Tank' is not taken into the calculation.
If I understand correctly, maybe something like this might work:
Sum({<MeasureNo={1,2,3,4,5}>} (Aggr(If(Max({<MeasureNo={1,2,3,4,5}>}MeasureValue)<=CuMax and Min({<MeasureNo={1,2,3,4,5}>}MeasureValue)>=CuMin,Count({<MeasureNo={1,2,3,4,5}> }WorkOrder)),WorkOrder)))
or without the Aggr() function:
Count({$<MeasureNo={1,2,3,4,5},WorkOrder={"=Max({$<MeasureNo={1,2,3,4,5}>}MeasureValue)<=CuMax and Min({$<MeasureNo={1,2,3,4,5}>}MeasureValue)>=CuMin"}>} WorkOrder)