This is a migrated thread and some comments may be shown as answers.

How to get time interval value from report data in group

1 Answer 106 Views
Report Designer (standalone)
This is a migrated thread and some comments may be shown as answers.
Su
Top achievements
Rank 1
Su asked on 10 Oct 2019, 05:08 AM

hi,

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 
Name,QtyName,DateTime
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 

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

I have also attached the sample report. 
Thank you

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 14 Oct 2019, 03:24 PM

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.

Regards,
Todor
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
Tags
Report Designer (standalone)
Asked by
Su
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or