Hi Community,
I have a calculated field that uses LAC-A, let’s say:
[topSales]
max({sales}, [{region}])
I now want to do period over period calculations for this measure across multiple periods (so the KPI visual won’t be sufficient) but as mentioned in various other posts, periodOverPeriodPercentDifference does not accept LAC-A measures.
However, I found by chance that percentDifference can actually be used to achieve the same as periodOverPeriodPercentDifference AND accepts LAC-A calculated fields.
Could someone please explain this to me? If it’s working with one of the functions, I am wondering whether the other one could be adapted as well and whether it’s worth raising this as a feature request.
Thanks a lot in advance!
Hi @bubate,
Thanks for posting this! I believe the reason comes down to how these functions are evaluated internally. So for periodOverperiodPercentDifference, its a higher-level “convenience” function that applies its own aggregation logic and has stricter input validation, it expects a simple aggregate, not a pre-computed LAC-A. percentDifference, on the other hand, operates on whatever value you pass it at the row/partition level without re-aggregating, so it’s more flexible in what it accepts.
The fact that percentDifference gives you the same result means you’ve found a valid workaround, you’re essentially computing the period-over-period difference manually by using percentDifference with the appropriate partition and sort.
And as for your last question, I think yes, this is a valid feature request so I’ll go ahead and tag it as such and archive this to promote visibility to the AWS team.
I hope the above explanation made sense!