Forum Discussion

AvanderKnijff's avatar
AvanderKnijff
New Member
3 years ago
Solved

Tracking dashboard

Hi Guys,

 

I want to create a dashboard showing the rides of assets. I have a table listing tracking events like start, moving, stop. So a typical Ride for one device has a start, one or more moving records and a stop record.

 

TimeDeviceIDeventTypelatlon

msgCounter

12:001start00

1

12:051moving11

2

12:101moving12

3

12:151stop13

4

 

Now the trouble is that I have one table for multiple assets.  like;

 

TimeDeviceIDeventTypelatlon

msgCounter

12:001start00

1

12:022moving11

2

12:101moving12

2

12:154start13

4

12:151stop13

3

12:162stop22

3

12:174moving22

5

12:204stop23

6

 

To be able to show rides on a dashboard I need to create a unique RideID for every ride of a given device

 

TimeDeviceIDeventTypelatlon

msgCounter

RideID

12:001start00

1

1

12:022moving11

2

2

12:101moving12

2

1

12:154start13

4

1

12:151stop13

3

1

12:162stop22

3

2

12:174moving22

5

1

12:204stop23

6

1

12:301start13

4

2

12:311moving13

5

2

21:321moving14

6

2

21:331stop15

7

2

21:362start22

4

3

 

With the RideID I should be able to create a unique column by concatinating rideid with deviceid. With that colum I would than be able to filter in a dashboard.

 

Any tips or sugestions how to calculate the RideId colum?

 

thanks in advance KR Arjen

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi AvanderKnijff ,

     

    Group the table by stop time:

    Column = 
    var _end = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[eventType]="stop"&&'Table'[Time]>=EARLIER('Table'[Time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])))
    return
    IF(ISBLANK(_end),'Table'[Time],_end)

    Then rank the group in same device ID.

    Column = 
    var _end = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[eventType]="stop"&&'Table'[Time]>=EARLIER('Table'[Time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])))
    return
    IF(ISBLANK(_end),'Table'[Time],_end)

     

    Best Regards,

    Jay

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi AvanderKnijff ,

     

    Group the table by stop time:

    Column = 
    var _end = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[eventType]="stop"&&'Table'[Time]>=EARLIER('Table'[Time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])))
    return
    IF(ISBLANK(_end),'Table'[Time],_end)

    Then rank the group in same device ID.

    Column = 
    var _end = CALCULATE(MIN('Table'[Time]),FILTER('Table','Table'[eventType]="stop"&&'Table'[Time]>=EARLIER('Table'[Time])&&'Table'[DeviceID]=EARLIER('Table'[DeviceID])))
    return
    IF(ISBLANK(_end),'Table'[Time],_end)

     

    Best Regards,

    Jay

    • AvanderKnijff's avatar
      AvanderKnijff
      New Member

      Hi Jay,

       

      Thanks for your help, I managed to do the group by. This realy helps! I'm able to do a filter based on time.

       

      The ranking would be helpfull to be able to list the start and end of a given ride on one row. However, the given ranking formula is a duplicate of the grouping. Could you share the ranking formula or do I misunderstood your solution?

       

      First, step now is to understand the first formula 🙂

       

      Thanks in advance, KR Arjen