Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
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

Labels (1)
1 Solution

Accepted Solutions
swuehl
Champion III
Champion III

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
Champion III
Champion III

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