Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to compare two aggrs in an if, but the comparison doesn't return the result I want...
aggr1 :
aggr(Only({$<DATE_START={"<=$(=vDATE1)"},DATE_END={">$(=vDATE1)"},STATE_ID -= {'Out'}>}ATTRIBUTE),ID)
The result is -> 'XX'
aggr2 :
aggr(Only({$<DATE_START={"<=$(=vDATE2)"},DATE_END={">$(=vDATE2)"},STATE_ID -= {'Out'}>}ATTRIBUTE),ID)
The result is -> 'XX'
If :
If(aggr(Only({$<DATE_START={"<=$(=vDATE1)"},DATE_END={">$(=vDATE1)"},STATE_ID -= {'Out'}>}ATTRIBUTE),ID) = aggr(Only({$<DATE_START={"<=$(=vDATE2)"},DATE_END={">$(=vDATE2)"},STATE_ID -= {'Out'}>}ATTRIBUTE),ID),Null(),ID)
The result is -> ID
Except that as the two aggr are identical, I'll end up with a Null.
Why doesn't the comparison work?
Thank you very much.
I've found a solution to my problem. I simply replaced the "=" between the aggr() with a "like".
Thank you very much for your help!
Hi,
Have broken the Set analysis down?
I.e. Created a table with Above and comparing? Ensuring that the Aggr is always bring through a single value for the only function on both sides?
The value is unique for each id
Just that it can change according to the date, and the goal is to display only the IDs that may have changed between two dates
You may try it in this way:
If(aggr(
Only({$<DATE_START={"<=$(=vDATE1)"},DATE_END={">$(=vDATE1)"},STATE_ID -= {'Out'}>}ATTRIBUTE) <>
Only({$<DATE_START={"<=$(=vDATE2)"},DATE_END={">$(=vDATE2)"},STATE_ID -= {'Out'}>}ATTRIBUTE),
ID),ID)
It always returns a value 😕
What happens if you put ID as dimension in a table-chart and both only() calculations without the aggr() as single expressions and a third one comparing them?
What is the dimension you are using in your chart?
I've found a solution to my problem. I simply replaced the "=" between the aggr() with a "like".
Thank you very much for your help!