Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Greater Than another set

Hi,

I'm trying to build a set based on values that are greater than another set. I started with this

Count({$ <QuestionID = {'Q22'}, Q22Benefit2 = {">=55"}>} RespKey)

the value 55 is actually meant to be an average of all scorse across a set of all products. So, I built this into my load script using a field called TBIOverallAverage. the expression became:

Count($ <QuestionID = {'Q22'}, Q22Benefit2 = {">=TBIOverallAverage"}>} RespKey)

This doesn't work.

The actual formula I want to get to is something like:

Count({$ <QuestionID = {'Q22'}, Q22Benefit2 = {">=

          Avg({$ QuestionID = {'Q22'}"}>} TOTAL <Country, Wave, TargetGroupID> Q22Benefit2RespKey)"}>} RespKey)

This is supposed to represent the number of RespKey who have a value that is greater that the average of all the values.

Any help would be appreciated.

Regards,

Pete

1 Solution

Accepted Solutions
swuehl
MVP
MVP

Maybe like

Count({$ <QuestionID = {'Q22'},

Q22Benefit2 = {"=Q22Benefit2 >=

          Avg({$<QuestionID = {'Q22'}"}>} TOTAL <Country, Wave, TargetGroupID> Q22Benefit2RespKey)"}

>} RespKey)

or

Count({$ <QuestionID = {'Q22'},

Q22Benefit2 = {"=Q22Benefit2 >=

          $(=Avg({$<QuestionID = {'Q22'}"}>} TOTAL <Country, Wave, TargetGroupID> Q22Benefit2RespKey))"}

>} RespKey)

Regards,

Stefan

View solution in original post

2 Replies
swuehl
MVP
MVP

Maybe like

Count({$ <QuestionID = {'Q22'},

Q22Benefit2 = {"=Q22Benefit2 >=

          Avg({$<QuestionID = {'Q22'}"}>} TOTAL <Country, Wave, TargetGroupID> Q22Benefit2RespKey)"}

>} RespKey)

or

Count({$ <QuestionID = {'Q22'},

Q22Benefit2 = {"=Q22Benefit2 >=

          $(=Avg({$<QuestionID = {'Q22'}"}>} TOTAL <Country, Wave, TargetGroupID> Q22Benefit2RespKey))"}

>} RespKey)

Regards,

Stefan

lironbaram
Partner - Master III
Partner - Master III

hei

attch is an example

may be you'll find it helpful