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

Aggr Only not working when filtering a field

Hello everyone, I have a dimension in which I show only the components that are part of the Material A:

 

=Aggr(Distinct Only({<Material = {'A'}>} Component), Component). 

 

This works perfectly if I dont filter any other field.

 

However, when I filter another field "[Material Group]" for example, my aggr dimension returns only null values.

I've already tried these two approaches but they dont work:

=Aggr(Distinct Only(1{<Material = {'A'}>} Component), Component). 

=Aggr(Distinct Only({<[Material Group]=,Material = {'A'}>} Component), Component). 

 

Thank you 

Labels (1)
3 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Try this

Aggr({1}Distinct Only({1<Material = {'A'}>} Component), Component). 

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
gitguto
Contributor III
Contributor III
Author

Thanks for your reply, it didn't work. It also returns null values.

BrunPierre
Master
Master

Hi,

Try these expressions

Aggr(Distinct Only(Total{<Material = {'A'}>} Component), Component)

or

Maxstring({<[Material Group]=>} Aggr(Distinct Only({<[Material Group]=,Material = {'A'}>} Component), Component))