Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
SaraKalemba
Contributor II
Contributor II

Max of data who is equals to the Aggr

Hi,

I am struggling with set analysis.

I have dataset: 

TypeParty_IDDateSales
Customer11/jan1
Customer12/jan0
Customer21/jan0
Customer22/jan1
Customer22/jan0

 

I want the Max of Sales for the last Date per Party_ID

+ Date can change based on filtering of end-user

+ Party_ID will not be diplayed in end table => there also must be a TOTAL SUM 

+ only records where Type='Customer' must be taken into the calcullation.

Result (before removing Party_ID):

TypeParty_IDDateSales 
Customer12/jan0 
Customer22/jan1(=Max)

 

 

Labels (1)
1 Solution

Accepted Solutions
SaraKalemba
Contributor II
Contributor II
Author

This one gave me the wanted result: Sum(Aggr(FirstSortedValue({<RAC_DIMENSION={'CUSTOMER'}>} PURE_CHURN_60D, -Aggr(Max({1<RAC_DIMENSION={'CUSTOMER'}>} CONTACT_TIMESTAMP),[Year-Month], PARTY_ID)),[Year-Month],PARTY_ID))

View solution in original post

2 Replies
SaraKalemba
Contributor II
Contributor II
Author

I already got this formula:

Sum(Aggr(FirstSortedValue({<RAC_DIMENSION={'CUSTOMER'}>} PURE_CHURN_60D, -Aggr(Max({<RAC_DIMENSION={'CUSTOMER'} >} CONTACT_TIMESTAMP), PARTY_ID)),PARTY_ID))

SaraKalemba
Contributor II
Contributor II
Author

This one gave me the wanted result: Sum(Aggr(FirstSortedValue({<RAC_DIMENSION={'CUSTOMER'}>} PURE_CHURN_60D, -Aggr(Max({1<RAC_DIMENSION={'CUSTOMER'}>} CONTACT_TIMESTAMP),[Year-Month], PARTY_ID)),[Year-Month],PARTY_ID))