DATA Step, Macro, Functions and more

calculate most loyal customer within dataset and divide data set into three categories.

Reply
Occasional Contributor
Posts: 5

calculate most loyal customer within dataset and divide data set into three categories.

i want to calculate most loyal customer from data set and also divide this dataset into three categories equally based on total number of customer.

the dataset attached here. 

inv no,stockCode,Qty,InvDate,UnitPrice,Customer,Country

573010, 851235,6,01/12/2017,3.34,17852,US

..

..

..

..

..

this file is .CSV and contain number of different customer.

,

SAS Moderator
Posts: 47

Re: calculate most loyal customer within dataset and divide data set into three categories. [how to improve your question]

Posted in reply to Raavi2507

Hello @Raavi2507,


Your question requires more details before experts can help. Can you revise your question to include more information? 

 

Review this checklist:

  • Specify a meaningful subject line for your topic.  Avoid generic subjects like "need help," "SAS query," or "urgent."
  • When appropriate, provide sample data in text or DATA step format.  See this article for one method you can use.
  • If you're encountering an error in SAS, include the SAS log or a screenshot of the error condition. Use the Photos button to include the image in your message.
    use_buttons.png
  • It also helps to include an example (table or picture) of the result that you're trying to achieve.

To edit your original message, select the "blue gear" icon at the top of the message and select Edit Message.  From there you can adjust the title and add more details to the body of the message.  Or, simply reply to this message with any additional information you can supply.

 

edit_post.png

SAS experts are eager to help -- help them by providing as much detail as you can.

 

This prewritten response was triggered for you by fellow SAS Support Communities member @draycut

.
Super User
Posts: 13,023

Re: calculate most loyal customer within dataset and divide data set into three categories.

Posted in reply to Raavi2507

@Raavi2507 wrote:

i want to calculate most loyal customer from data set and also divide this dataset into three categories equally based on total number of customer.

 


Define how we are to identify "most loyal customer" from the given data?

Most purchases? Largest total of purchases? Shortest interval between multiple purchases? Largest number of different products purchased?

 

Provide rules and what the desired output would look like.

Ask a Question
Discussion stats
  • 2 replies
  • 91 views
  • 0 likes
  • 3 in conversation