Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
peachman
Contributor III
Contributor III

SET analysis - Count With Greater/Less Than Conditions

Consider the following table of data consisting of Time and Target for that time, and Quality and Target for Quality.

GroupTimeTime TargetQualityQuality Target
1100 (1)1150.10 (1)0.15
2111 (1)116 0.11 (1)0.12
31231160.320.13
41201170.090.12
575 (1)1180.230.11
61321190.110.17

 

I wish to get a KPI to COUNT the following conditions

  1. Where TT is Less than the Target
  2. Where Quality is Less than the Target
  3. Where Product = 'Proudct 1'
  4. Where WK = 'WK1'

Each group has a different target so i cannot use a fixed value but i need to use the column Name within the expression.

The below does not work.

 

=COUNT({<Qual = {"<$(Targ_Qual)"}, Time = {"<$(Targ_Time)"},PRODUCT={"Product 1"},WK={"WK1"} >}DISTINCT OUC)

 

Labels (3)
1 Solution

Accepted Solutions
dplr-rn
Partner - Master III
Partner - Master III

it is possible to do comparisons of columns in set analysis syntax is soemthing like this.

 

Identifier= {"=Qual<Targ_Qual"}

 but i have not tried a situation with and condition  (targ time and targ_qual)

if they are in same table i would create a flag in the script and use that in the set analysis.

View solution in original post

2 Replies
dplr-rn
Partner - Master III
Partner - Master III

it is possible to do comparisons of columns in set analysis syntax is soemthing like this.

 

Identifier= {"=Qual<Targ_Qual"}

 but i have not tried a situation with and condition  (targ time and targ_qual)

if they are in same table i would create a flag in the script and use that in the set analysis.

peachman
Contributor III
Contributor III
Author

I have ended up getting a solution by make 2 flag fields in the data as suggested. then using this in the set anaysis.

 

Still curious on how to do this without the flag field to save on space?