Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Giel0
Contributor
Contributor

Exclude filter in Aggr function

Hey all,

I have an aggregation function and I want to exclude the month-filter (Maand) to have effect on the outcome of the sum.

Found several topics and tried several things but nothing helps. Currently the following formula is what I have:

(sum({<Maand=>}AGGR(IF(SUM({<Jaar={2022}, Collectiejaar2022 = {'2022'},Maand=>}Afzet)>=VerpakkingsEenh,1,0),Productcode))) 

Thanks in advance!

Labels (2)
7 Replies
vinieme12
Champion III
Champion III

try below

 

=(sum({<Maand=>}

AGGR({<Maand=>}

IF(SUM({<Jaar={2022}, Collectiejaar2022 = {'2022'},Maand=>}Afzet)>=VerpakkingsEenh,1,0)

,Productcode))) 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Giel0
Contributor
Contributor
Author

Hey @vinieme12,

 

Thanks for your reply.

Unfortunately it doesn't work. Outcome is still affected when filtering on Maand. 

vinieme12
Champion III
Champion III

do you have any calculated dimensions in the chart?

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Giel0
Contributor
Contributor
Author

No all dimensions are directly from tables in load script editor

 

vinieme12
Champion III
Champion III

=(sum({<Maand=>}

AGGR({<Maand=>}

IF(SUM({<Jaar={2022}, Collectiejaar2022 = {'2022'},Maand=>}Afzet)>=SUM({<Jaar={2022}, Collectiejaar2022 = {'2022'},Maand=>}VerpakkingsEenh),1,0)

,Productcode))) 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
Giel0
Contributor
Contributor
Author

Hi Vinieme12,

This formula gives incorrect output : 0 

Do you might know another solution? I read several things about Only() but don't know exactly if it can be used in my formula or how to implement it. 

Thanks again!

 

agigliotti
Partner - Champion
Partner - Champion

Hi @Giel0 ,

I suggest you to use alternates states to achieve what you are looking for.

I hope it can helps.

Best Regards