How to get time interval value from report data in group

2 posts, 0 answers
  1. Su
    Su avatar
    2 posts
    Member since:
    Mar 2018

    Posted 10 Oct 2019 Link to this post


    I would like to display the datetime interval value from data field.
    I am using the standalone report designer and my report has chart and summary data by group. I have tried out the aggregate function but my function will display the interval for inner group only. Kindly help to advise how to get this?

    The report data structure would be like the following 
    DV10002,Current Phase B,2016-09-05 00:15:00
    DV10002,Current Phase B,2016-09-05 00:30:00
    DV10002,Current Phase B,2016-09-05 00:45:00
    DV10002,Current Phase B,2016-09-05 01:00:00
    DV10003,Current Phase B,2016-09-05 01:00:00
    DV10003,Current Phase B,2016-09-05 01:30:00
    DV10003,Current Phase A,2016-09-05 01:00:00
    DV10003,Current Phase A,2016-09-05 01:30:00

    e.g  DV10002 
           Current Phase B
           Interval : 15 mins
           DV10002  Summary 

    Current Phase B
    Current Phase A
           Interval : 30 mins
           DV10003 Summary 

    I have also attached the sample report. 
    Thank you

  2. Todor
    Todor avatar
    451 posts

    Posted 14 Oct 2019 Link to this post

    Hello Su,

    You may use the Previous Data function to get the Time Difference between two consecutive records, for example with an Expression like:

    = Fields.DateTime - Previous("Detail", Fields.DateTime)

    The scope "Detail" in the expression denotes the inner-most Report Group.

    I have attached a sample report that demonstrates the approach. The first value will be blank since it does not have a previous one.

    If the intervals are regular for each group you may consider introducing a dedicated property (e.g. of type TimeSpan) and display it in the group header/footer only once.

    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top