Hi,
I have the attached dataset structure and I want to figure out how to calculate the aggregation of total_number_of_nights_for_travel per company_id.
I tried using sum(maxOver(number_of_nights_for_travel, [travel_id],PRE_AGG))
but it just gave me a summary of the max value for each travel_id multiplied by the number of record appearance (as number of charge_id)
company_id | trans_id | travel_id | number_of_nights_for_travel | total_number_of_nights_for_travel |
---|---|---|---|---|
AA | 111 | 12 | 8 | 25 |
AA | 222 | 12 | 8 | 25 |
AA | 333 | 12 | 8 | 25 |
AA | 444 | 12 | 8 | 25 |
AA | 555 | 15 | 17 | 25 |
AA | 666 | 15 | 17 | 25 |
AA | 777 | 15 | 17 | 25 |
BB | 888 | 17 | 21 | 21 |
BB | 999 | 17 | 21 | 21 |
Any ideas?
Thanks!