Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Nolgath
Creator
Creator

How to ignore a field from filter pan in my expression

My expression : 

avg(aggr(COUNT({1<country={"$(=only(country))"}, vehicleStatus={0}, dealer-={'-'}>} vehicleStatus), dealer, country))

 

I need somehow to tell it that it must not react to 'dealer'.

With this expression when I choose dealer, it reacts to it.

Labels (4)
1 Solution

Accepted Solutions
Vegar
MVP
MVP

You have two aggregation functions in you expression.

avg( aggr( COUNT( {1<country={"$(=only(country))"}, vehicleStatus={0}, dealer=>} vehicleStatus), dealer, country))

You need to ignore  dealer in the outer avg aggregation as well. Try this:

avg({$<dealer=>}aggr(COUNT({1<country={"$(=only(country))"}, vehicleStatus={0}, dealer=>} vehicleStatus), dealer, country))

View solution in original post

5 Replies
deepanshuSh
Creator III
Creator III

If You want all the records then that's why you must have used the 1 in the set analysis. If not that might create an error. 

for excluding the dealer just write the equation like this. 

avg(aggr(COUNT({1<country={"$(=only(country))"}, vehicleStatus={0}, dealer=>} vehicleStatus), dealer, country))

Trial and error is the key to get unexpected results.
Nolgath
Creator
Creator
Author

I've tried that as well.. Can't seem to get out of this one..

 

it blocks on country but if I choose dealer it just sums them up instead of avg count

deepanshuSh
Creator III
Creator III

Ideally this should work, try to breakdown the equation into parts, 

avg(aggr(COUNT({1<country={"$(=only(country))"}, vehicleStatus={'0'}, dealer=>} vehicleStatus), dealer, country))

 

COUNT({<country={"$(=only(country))"}, vehicleStatus={'0'}, dealer=>} vehicleStatus)

,also, check for if the condition is running after the country in the code. 

 

COUNT({<country=, vehicleStatus={'0'}, dealer=>} vehicleStatus)

Trial and error is the key to get unexpected results.
Vegar
MVP
MVP

You have two aggregation functions in you expression.

avg( aggr( COUNT( {1<country={"$(=only(country))"}, vehicleStatus={0}, dealer=>} vehicleStatus), dealer, country))

You need to ignore  dealer in the outer avg aggregation as well. Try this:

avg({$<dealer=>}aggr(COUNT({1<country={"$(=only(country))"}, vehicleStatus={0}, dealer=>} vehicleStatus), dealer, country))

Nolgath
Creator
Creator
Author

Thank you! It worked just as I needed!

I have 2 more field i need, this are only avg() of some field per country

I have this:

avg({<country=country>}currentPrice)

but this still reacts to "dealer" and I've seen everything should be ok. Do you know anything about this mr Vegar