8 Replies Latest reply on Sep 10, 2018 12:23 PM by Deepak Rai

    Calculate the time difference and list the top N clients

    manoj kumar

      Hi Everyone,

       

      My name is Manoj and i'm new to Tableau. I have a data set which has Date&time, client name & tickets purchased by them for each hour.

       

      I have attached the sample data set below. My requirement is to list down top N clients based on each hour time stamp. Say if the present time is 11 AM.

       

      In my dashboard, i wanted to display the Top N clients in the below-mentioned format (separate worksheets). Could you please suggest how to do the calculation.

       

      Worksheet 1 for Top N clients for the current hour.

      Worksheet 2 for Top N clients for the last two hours (Say now time is 11 AM, then the top N tickets sold by clients between 9AM -10 AM)

      Worksheet 3 for Top N clients for the last two hours (Top N tickets sold by clients between 7AM - 8 AM)

       

      Thank you in advance

       

      Regards,

      Manoj

       

      Date & Time

      Clients

      TotalTicketes

      9/9/2018 12:59:59 AM

      Client-1

      100

      9/9/2018 1:59:59 AM

      Client-1

      121

      9/9/2018 2:59:59 AM

      Client-1

      110

      9/9/2018 3:59:59 AM

      Client-1

      32

      9/9/2018 4:59:59 AM

      Client-1

      234

      9/9/2018 5:59:59 AM

      Client-1

      234

      9/9/2018 6:59:59 AM

      Client-1

      543

      9/9/2018 12:59:59 AM

      Client-2

      200

      9/9/2018 1:59:59 AM

      Client-2

      300

      9/9/2018 2:59:59 AM

      Client-2

      10

      9/9/2018 3:59:59 AM

      Client-2

      32

      9/9/2018 4:59:59 AM

      Client-2

      234

      9/9/2018 5:59:59 AM

      Client-2

      390

      9/9/2018 6:59:59 AM

      Client-2

      123

      9/9/2018 12:59:59 AM

      Client-3

      3000

      9/9/2018 1:59:59 AM

      Client-3

      1200

      9/9/2018 2:59:59 AM

      Client-3

      10

      9/9/2018 3:59:59 AM

      Client-3

      11

      9/9/2018 4:59:59 AM

      Client-3

      543

      9/9/2018 5:59:59 AM

      Client-3

      32

      9/9/2018 6:59:59 AM

      Client-3

      21