Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
All,
I have a requirement to show all transactions on the last date before a selected date. So I have a variable vDate which the user can select.
I then calculated the last date before the selected date
Max({<IndexDate = {'<$(=Date($(vDate)))'}>}IndexDate))
I think want to use this within set analysis to sum the sales on that date
sum({$<IndexDate={"=$(=Max({<IndexDate = {'<$(=Date($(vDate)))'}>}IndexDate))"}>} Sales)
Please see attached. This works when I put less than or greater than in the expression but not equals.
sum({$<IndexDate={">=$(=Max({<IndexDate = {'<$(=Date($(vDate)))'}>}IndexDate))"}>} Sales)
sum({$<IndexDate={">=$(=Max({<IndexDate = {'<$(=Date($(vDate)))'}>}IndexDate))"}>} Sales)
My questions:
1. Can anyone explain why its not working or correct my "equals" formula
2. Also, if there is a better way of doing this, I'm open to suggestions
I've attached a simple example, as ever the loaded data is vastly more complicated
Thanks,
Karl !
Are you looking for something like this?
=FirstSortedValue(DISTINCT {<IndexDate = {"<$(=Date($(vDate)))"}>} Aggr(Sum({<IndexDate = {"<$(=Date($(vDate)))"}>} Sales), IndexDate, Company), -Aggr(Only({<IndexDate = {"<$(=Date($(vDate)))"}>} IndexDate), IndexDate, Company))