6 Replies Latest reply on Jun 11, 2019 11:22 PM by Hari Ankem

# How to calculate the number of visits needed to clock \$x sales?

Hi all,

I need to find out the number of visits each customer took in order to achieve \$200, \$300 and \$500 total spend for our customer incentive program.

The dates of visits have to be in ascending order of each customer so that running sum of sales would be logical.

I tried running sum, rank, but not able to find a solution.

I have attached a set of dummy data of customer sales.

Hope someone in the community can have a solution.

Thank you!

CustomerNo of visitsParameter of total Spending
John Doexx\$200
John Doexx\$300
John Doexx\$500
• ###### 1. Re: How to calculate the number of visits needed to clock \$x sales?

This maybe one of the easiest way but it does repeat the parameter as I have my days in the view.

Do take note that if you want to count the No of visits we will have to take into consideration of something unique and order date might not be good as a customer may visit twice during the day, you may want to consider a unique value like a receipt ID. In your attached data  there isn't any unique ID that I can count so I used # of records instead.

It really depends how your actual data are structured. HTH

1 of 1 people found this helpful
• ###### 2. Re: How to calculate the number of visits needed to clock \$x sales?

Is this the expected output?

If yes, please see the solution in the attached workbook.

3 of 3 people found this helpful
• ###### 3. Re: How to calculate the number of visits needed to clock \$x sales?

Yes!!

This is the expected output. But I am not able to open the file as your workbook is a newer version. Can I trouble you to save as a lower version 2018.3.2?  Thank you so much.

• ###### 4. Re: How to calculate the number of visits needed to clock \$x sales?

Attaching 2018.3 version.

• ###### 5. Re: How to calculate the number of visits needed to clock \$x sales?

Thank you very much Hari! This saved my day

• ###### 6. Re: How to calculate the number of visits needed to clock \$x sales?

You are welcome. If you do not have any further questions related to this thread, appreciate if you can mark it as answered and close it.