Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
spikenaylor1
Creator
Creator

Expression issues for working out how many batches are correct with other criteria included

We have a Batch that when completed contains 16 documents 

of that 16 documents, 14 have to be right first time.

I need an expression to say

count how many Batch_Numbers where count(doc_name)=16 and where sum(RFT) = >14

just struggling to work out the correct layout of this type of expression

 

many thanks for any help

 

 

 

6 Replies
dplr-rn
Partner - Master III
Partner - Master III

try with set analysis e.g.
count({<doc_name={"sum(RFT) >=14"}>}doc_name)
spikenaylor1
Creator
Creator
Author

count({<doc_name={"sum(RFT) >=14"}>}doc_name)  just gives me 0

I can see what it is trying to do, but the formula just not working

 

Regards

 

dplr-rn
Partner - Master III
Partner - Master III

share some sample data/ app. will check.
spikenaylor1
Creator
Creator
Author

here is eventually some sample data

I need the expression to be in a text box, so I can display the numbers and then percentages etc

 

thanks for any help with this

once I get one expression working, I can move on.

dplr-rn
Partner - Master III
Partner - Master III

Almost there. you need to match set analysis row with a key/identifier dimension you need from the table.

=count(DISTINCT {<Batch_Number={"=sum(RFT) >=14"}>}Batch_Number)

see attached copy with the text box

 

spikenaylor1
Creator
Creator
Author

Yep that works, missed the distinct, brain to focussed on the actual sum formula.

 

Not fully got these set analysis cracked yet, how would I now incorporate:

 

count Batches where RFT is >=14  and sum(Downtime)=0 and sum(DeviationValue) =0

 

so in the example in previous post

I have 3 batches

batch AB1236  is NOT RFT

Our expression result is 2

If the batch AB1236 also had a downtime entry, We would still have 2 Batches correct

 

If batch AB1234 had a downtime entry then we now have only 1 batch correct

Our expression result would now be 1

If Batch AB1234 also had Deviation entry, we would still have only 1 Batch Correct

 

etc

 =count(DISTINCT {<Batch_Number={"=sum(RFT) >=14","=sum(Downtime) =0"}>}Batch_Number) - expression correct but does not work.

Tried other combinations

Tried 

=count(DISTINCT {<Batch_Number={"=sum(RFT) >=14"}>}Batch_Number) - count(DISTINCT {<Batch_Number={"=sum(Downtime) =0"}>}Batch_Number)

 

Many thanks for any help