Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have following data -
Product | Location | Date | Sales |
A | Z | 01-01-2013 | 100 |
A | Z | 01-01-2013 | 100 |
A | Z | 31-11-2012 | 200 |
B | Y | 12-12-2012 | 300 |
1. I want to identify MAX(Date) group by location id.
2. Then calculate the SUM(Sales) based on MAX(Date) returned by step 1.
The result should be as follows -
Product | Sales | |
A | 200 | Since 01-01-2013 is the max date in location Z |
B | 300 |
Please help me how I can achieve this in straight table.
Regards,
Samir Prasadi.
You can try this as expression in your table :
Sum(aggr(
FirstSortedValue(aggr(
Sum(Sales)
,Product,Location,Date),-Date)
,Product))
Br.
Hi,
This is not working inmy application.
Regards,
Samir
Are you expecting this in load script or charts?
In the Chart.
I tried the following expression in the chart expression -
SUM(
IF(
AGGR(MAX(DATE)), LOCATION) = DATE, SALES
)
)
but this does not work ..
Can you upload a sample file that you are working with?
I have attached a sample app.
Regards,
Samir
Please check the attached file
Hi,
Thanks for your response. This is working fine on the test file but the logic is not working on my production dashboard. Is there any other way to get solution for this scenario ?
Regards,
Samir.