Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
BI & Data Trends 2021. Discover the top 10 trends emerging in today. Join us on Dec. 8th REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor II
Contributor II

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
Highlighted
Partner
Partner

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
Highlighted
Partner
Partner

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

Highlighted
Contributor II
Contributor II

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?