Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Sxbbb
Creator III
Creator III

I only need MeasureValue where MeasureNo = 1,2,3,4,5

I have a field 'MeasureNo ' , 'MeasureValue' , 'WorkOrder'

in field  'MeasureNo' contains data  '1' , '2', '3' ,'4', '5', ' Tank'

Sxbbb_0-1679386426945.png

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

 

 

 

 

3 Replies
MarcoWedel

please try to explain what your are actually trying to calculate,
best using some sample data and your expected result.

Sxbbb
Creator III
Creator III
Author

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.

 

 

 

 

MarcoWedel

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)