# QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for
Search instead for
Did you mean:
Highlighted
Partner

## Set Analysis multiple expressions

Hello everyone,

I'm trying to get the correct results for an expression that should:

• return the average of an "x" value
• only for the values of "x" whose average is between 5 and 10

I already tried the following:

• avg({\$<x={'\$(=avg(x))>5'},{'\$(=avg(x))<=10'}>}x)
• avg({\$<x={'\$(=avg(x))>5'}+{'\$(=avg(x))<=10'}>}x)
• avg({\$<x={'\$(=avg(x))>5'},x={'\$(=avg(x))<=10'}>}x)

Can't solve this, hopefully someone has the solution to this.

Thank you

1 Solution

Accepted Solutions
Highlighted
MVP

7 Replies
Highlighted
MVP

## Re: Set Analysis multiple expressions

Try:

• avg({\$<x={"=avg(x)>5 and avg(x)<=10"}>}x)

Edit: Corrected -removed '\$'

Highlighted
Champion II

## Re: Set Analysis multiple expressions

can you post a sample application and expected output?

Highlighted
Partner

## Re: Set Analysis multiple expressions

Still not working, thank you though

Highlighted
Partner

## Re: Set Analysis multiple expressions

LOAD * INLINE [

Data, Cod, X, Amount

14/11/2017, 000001, 3, 1000

14/11/2017, 000002, 6, 5000

14/11/2017, 000003, 7, 8000

14/11/2017, 000004, 2, 750

15/11/2017, 000001, 3, 1200

15/11/2017, 000002, 6, 6000

15/11/2017, 000003, 7, 7500

15/11/2017, 000004, 2, 1000

];

What I'm trying to get is a table with the sum of "Amount" for each Cod whose avg(X) is between 5 and 10

Cod | AvgX | AmountSum

000002 | 6 | 11.000

000003 | 7 | 15.500

Highlighted
MVP

Highlighted
Creator III

## Re: Set Analysis multiple expressions

Try like this

Sum({<Cod={"=Avg(X)>=5 and Avg(X)<=10"}>}Amount)

PFA

Highlighted
Partner

## Re: Set Analysis multiple expressions

Yes, seems like the expansion sign \$ was the culprit. Thank you!