Forum Discussion

danielrabinovit's avatar
danielrabinovit
Cloud Apps
05-12-2025
Solved

Formula for % of Day Driven Within Shift

  Hi everyone, I'm working on a widget in Sisense that analyzes driver activity, and I'm trying to calculate the percentage of each driver's total trip time that occurred during their scheduled shi...
  • Ido_QBeeQ's avatar
    05-12-2025

    Hi danielrabinovit 

    This is a classic case for a measured value which is a formula syntax in Sisense that allows you to filter a specific value or calculation. You can then create more complex form,ulas based off of multiple measured values and this way to basically create a % calculation where the numerator is filterewd differently than the denumerator.

    In your case you will need to create a formula which filters the numerator to "During Shift" and the denumerator to ALL shift_alignment types or values.

    (SUM(trip_duration_minutes),([shift_alignment])/(SUM(trip_duration_minutes),all([shift_alignment]))

    Then you can use this formula in any widget, and group it by driver, location, time or any other dimension you like.

    Note that the numerator [shift_alignment] section will need to be filtered to 'During Shift' this is explained in the documentation. 

    See this article for more specific explanations and I think exactly fits your use case (I actually wrote this article a while back when I used to work at Sisense ðŸ˜…)

    If you're looking to group it or create yet another nested query within this logic, you may need to use a multi-pass aggregation 

    If I can clarify this in any way please let me know, do not hesitate to reach out

    We're always here to help ðŸ˜€

    Ido from QBeeQ

    QBeeQ - Gold Sisense Partner

    [email protected]

    Feel free to subscribe to our newsletter to stay up to date with the latest QBeeQ news

     

     

  • Ido_QBeeQ's avatar
    05-12-2025

     danielrabinovit happy to hear it helped you!

    You can create a top X ranking filter within the measured value by applying the top filter and then setting the top X value and by what KPI you want to apply it, see screenshot below: