Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am using Aggr in dimension like this
aggr( if( sum({<Type={'LA'}>}Amount) > 0, Name ), Address, Rep).
If there is more than one "Name" for the combination of "Address" and "Rep" then it returns NULL.
If there is only one "Name" for the combination of "Address" and "Rep" then it returns that value.
I also tried with NODISTINCT but it did not work.
What am i doing wrong?
Thanks,
Jean
May be try this
Aggr(If(Sum({<Type={'LA'}>} Amount) > 0, Name), Name, Address, Rep)
or this
Aggr(If(Sum(TOTAL <Address, Rep> {<Type={'LA'}>} Amount) > 0, Name), Name, Address, Rep)
May be try this
Aggr(If(Sum({<Type={'LA'}>} Amount) > 0, Name), Name, Address, Rep)
or this
Aggr(If(Sum(TOTAL <Address, Rep> {<Type={'LA'}>} Amount) > 0, Name), Name, Address, Rep)
I tried the first one and it seems to be working.
Thanks.
So it seems that aggr can not return multiple values so you add name also in the dimensions so each value gets returned becasue then it will be only one value per name,
Yup, but keep in mind that now Sum({<Type={'LA'}>} Amount) > 0 is also evaluated at Name (in addition to Address and Rep) level vs. just checking Sum({<Type={'LA'}>} Amount) > 0 against Address and Rep.
Yeah, I got that and it works for this one
but
what if i need to include only Address and Rep
is it possible?
What do you mean include only Address and Rep? Not sure I understand?
I was responding to your comment
"Yup, but keep in mind that now Sum({<Type={'LA'}>} Amount) > 0 is also evaluated at Name (in addition to Address and Rep) level vs. just checking Sum({<Type={'LA'}>} Amount) > 0 against Address and Rep."
Right now the expression is getting evaluated at Name level too.
So I was asking what if i do not want to evaluate the expression at the Name level and just at Address and rep level but still include all names i.e. Aggr() should return multiple values.
Is it even possible?