Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
paolocamerini
Partner - Contributor III
Partner - Contributor III

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
7 Replies
tresesco
MVP
MVP

Try:

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


Edit: Corrected -removed '$'

vinieme12
Champion III
Champion III

can you post a sample application and expected output?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
paolocamerini
Partner - Contributor III
Partner - Contributor III
Author

Still not working, thank you though

paolocamerini
Partner - Contributor III
Partner - Contributor III
Author

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

tresesco
MVP
MVP

Capture.JPG

woshua5550
Creator III
Creator III

Try like this

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

PFA

paolocamerini
Partner - Contributor III
Partner - Contributor III
Author

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