2 Replies Latest reply on Jan 19, 2016 8:40 AM by Aasiyah Rashan

    how to select rows by using dimension types

    Aasiyah Rashan

      Hi All,

      I have a dataset which shows id number in one column and triggered or not in another.There are several observations for each id number each showing triggered or not. I want tableau to select the first time each ID number is triggered and return the time corresponding to that row. I'm not sure how to do that. I'm using tableau desktop 9.2. I have attached a workbook with sample data below. Any help would be appreciated.

      Thanks.

        • 1. Re: how to select rows by using dimension types
          Stephen Lavery

          Hi Aasiyah,

           

          This can be done by using a level of detail expression which looks at the first recorded date for each ID. But first, we need to create a calculated field that looks only at the triggered date:

           

          Call this calculated field "Triggered Date and Time":

           

          IF [Triggered]="Triggered" THEN [Date and time] END

           

          Then we can create our level of detail calculation which looks at the minimum date/time for the first time triggered for each ID:

           

          { FIXED [ID number]: MIN([Triggered Date and Time]) }

           

          This should do the trick. See the attached workbook.

           

          Kind Regards,

          Stephen

           

          Edit: Similarly, if you want to look at the first recorded date for each ID regardless if it is "Triggered" or "Not Triggered" use the LoD calculation:

           

          { FIXED [ID number]: MIN([Date and time]) }

          • 2. Re: how to select rows by using dimension types
            Aasiyah Rashan

            Hi Stephen,

            Thanks for the help. However I have a problem. This method works well when you use the field first time with id number. But what I want to do is count the number of first time triggers per hour. This dosent work because the second calculation causes date and time values to be counted more than once. Please see the workbook below for what I want. Is there a solution to this?

             

            Thanks

            Aasiyah.