
Re: Set analysis filter on function values within a range
Massimo Grossi Mar 3, 2015 4:47 PM (in response to holly heglin)maybe this
sum({$<customer={"=avg(margin/amount)>=.0"}*{"=avg(margin/amount)<=.2"}>} amount)
EDIT: PFA

a.qvw 168.0 K

Re: Set analysis filter on function values within a range
holly heglin Mar 3, 2015 4:41 PM (in response to Massimo Grossi )Thanks Massimo! This 'seems' to workat least my numbers add up now...I used Year (I have it in my data set) as the dimension and then used your expressions. One question so I can be comfortable with what this is doing:
What does the '*' between sets mean?

Re: Set analysis filter on function values within a range
Michael Gardner Mar 3, 2015 4:45 PM (in response to holly heglin)* returns the set of records that only belong to the overlapping data from the first and second sets (similar to an INTERSECT in SQL)



Re: Set analysis filter on function values within a range
Martin Pohl Mar 3, 2015 3:33 PM (in response to holly heglin)see attached
Regards

Com154779.qvw 152.0 K

Re: Set analysis filter on function values within a range
holly heglin Mar 3, 2015 4:16 PM (in response to Martin Pohl )Hello, thanksthis is nice and very close but I need to find customers with average margins in the given buckets as opposed to counting distinct instances. I am trying to modify with the aggr functionI will post above...


Re: Set analysis filter on function values within a range
holly heglin Mar 3, 2015 4:20 PM (in response to holly heglin)I have now also tried aggregated expressions:
sum(aggr(if(avg(margin/amount)>.2 and avg(margin/amount)<=.45,customer), amount))
which produces wildly large sums. I just don't know how to approach thiscalculated dimension, expression, aggregation...can't seem to get anything to return appropriate amounts.