2 Replies Latest reply on Aug 27, 2017 9:01 AM by Eze Nwa

# Number of transactions

Hello Tableau experts,

I really need some help please! I have a sample data set on horse betting in the table below which I'm trying to analyze

The data set has a fictitious customer name, Horse, Date and Time of transaction. I would like to use Tableau to calculate the fields in bold and I have provided the answers I'm expecting.

1. What is the number of days between the last and the previous transaction (Days_Diff)?
2. What is the Time Diff (seconds) between the last and previous transaction?
3. How many transactions has the specific customer executed in the last minute (COUNT_1 min), 5 mins (COUNT_5 min) and 24 hrs (COUNT_24 hrs), respectively.?
4. How many different horses has the specific customer placed bet on, in the last 24 hrs (COUNT_horses 24 hrs)?

I will so much appreciate your help with this! I'm using Tableau 10.2

 ID Name Horse Date Time (hh:mm:ss) Days Diff, if not same day Time diff (seconds), if same day COUNT_1 min COUNT_5 min COUNT_24 hrs COUNT_Horses 24 hrs 1 John Horse1 28/11/2016 11:10:01 1 1 1 1 2 John Horse2 28/11/2016 11:10:02 0 1 2 2 2 2 3 Kim Horse1 19/12/2016 10:12:46 1 1 1 1 4 Kim Horse2 31/12/2016 11:04:17 12 1 1 1 1 5 Kim Horse3 01/02/2017 10:43:08 32 1 1 1 1 6 Lisa Horse1 07/02/2017 15:43:53 1 1 1 1 7 Lucy Horse2 28/11/2016 11:26:02 1 1 1 1 8 Lucy Horse1 28/11/2016 11:37:01 0 659 1 1 2 2 9 Lucy Horse2 28/11/2016 11:40:34 0 213 1 1 3 2 10 Peter Horse2 23/07/2016 11:34:53 1 1 1 1 11 Peter Horse1 23/07/2016 11:36:42 0 109 1 2 2 2 12 Peter Horse3 23/07/2016 11:37:14 0 32 2 3 3 3 13 Peter Horse3 23/07/2016 11:39:51 0 157 1 4 4 3 15 Simon Horse1 08/11/2016 10:56:25 1 1 1 1 16 Simon Horse2 18/11/2016 16:59:34 10 21789 1 1 1 1 17 Simon Horse3 18/11/2016 17:41:47 0 2533 1 1 2 2

Thank you very much in advance,

Eze

Message was edited by: Eze Nwa Thanks Tom, I have just uploaded a packaged workbook indicating what I'm trying to do. Thank you very much! Eze

• ###### 1. Re: Number of transactions

IT would be easier for others to help if you prepared a packaged workbook - Packaged workbooks: when, why, how

• ###### 2. Re: Number of transactions

Hi Tom,

Thanks a million for your suggestion. I have just uploaded a packaged workbook in 10.2 to the original post. Looking forward to getting some help on this.

Thank you very much,

Eze