Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
jerfwork
Contributor III
Contributor III

Script to Prefix Max Value and Data

Hello all,

I would like to ask if below is possible? I would like to find out customer's favourite category by date for each customer in Script level but I'm unable to figure out. Below is my dataset.

CUSTOMER_NODATE_OF_PURCHASEDIMENSION
CustomerA30/04/2017Bags
CustomerA30/04/2017Bags
CustomerA30/04/2017Shoes
CustomerA30/04/2017Accessories
CustomerA29/04/2017Shoes
CustomerA29/04/2017Shoes
CustomerA29/04/2017Bags
CustomerA29/04/2017Accessories
CustomerB29/04/2017Shoes
CustomerB29/04/2017Shoes
CustomerB29/04/2017Bags
CustomerB29/04/2017Accessories


Expected Result:

CUSTOMER_NODATE_OF_PURCHASEDIMENSION
CustomerA30/04/2017Bags
CustomerA29/04/2017Shoes
CustomerB29/04/2017Shoes

 

Thank you in advance!

Labels (2)
1 Reply
jerfwork
Contributor III
Contributor III
Author

I managed to get the highest info now by using FirstSortedValue and COUNT, but if the dataset is showing as below. The result will be blank. Is that a possibility auto populate a random value from Category if it is blank?

CUSTOMER_NODATE_OF_PURCHASEDIMENSION
CustomerB28/04/2017Bags
CustomerB28/04/2017Accessories

 

Expected Result:

CUSTOMER_NODATE_OF_PURCHASEDIMENSION
CustomerB28/04/2017Bags