Hi,

Is there way to calculate time difference (in hours) between injections and also calculate % difference from preceding row, please see attached example.

Hi,

Is there way to calculate time difference (in hours) between injections and also calculate % difference from preceding row, please see attached example.

- 5 people found this helpful
Hello,

The first thing you will need to do is store the first injection time as a variable. Since you can only store numerical values as variables we need to convert the date. You can do this by calculating the data difference in seconds from a an arbitrary date in the past. See the example below where I filter a field for the first std acquisition date and then do a date difference from an arbitrary date in the past. You will see it on the report but I would hide that group on the final report. You can then use this to do your calculation. Now you may need to repeat this with your table if you are repeating the table with different initial reference injections for time 0.

In the example, I added the injection acquisition date field and changed the value to calculate the date difference in seconds from an arbitrary time. =DateDiff("s","19-Aug-04 00:00:00",First(Injection_AcquiredDate)) Then I created a group with the single field and repeated it on a number so that it can be filtered it without it repeating. Then I placed a filter that group for just the standards so that it picks up just the first standard.

I then stored the value as a variable using the Save Expression Result As button and gave the variable a name.

Once the value was stored I used it in the table below to calculate the injection time difference from the first injection. =(DateDiff("s","19-Aug-04 00:00:00",Injection_AcquiredDate)-DateInjSec)/60 You can see this in the example report below.

Hello,

The first thing you will need to do is store the first injection time as a variable. Since you can only store numerical values as variables we need to convert the date. You can do this by calculating the data difference in seconds from a an arbitrary date in the past. See the example below where I filter a field for the first std acquisition date and then do a date difference from an arbitrary date in the past. You will see it on the report but I would hide that group on the final report. You can then use this to do your calculation. Now you may need to repeat this with your table if you are repeating the table with different initial reference injections for time 0.

In the example, I added the injection acquisition date field and changed the value to calculate the date difference in seconds from an arbitrary time. =DateDiff("s","19-Aug-04 00:00:00",First(Injection_AcquiredDate)) Then I created a group with the single field and repeated it on a number so that it can be filtered it without it repeating. Then I placed a filter that group for just the standards so that it picks up just the first standard.

I then stored the value as a variable using the Save Expression Result As button and gave the variable a name.

Once the value was stored I used it in the table below to calculate the injection time difference from the first injection. =(DateDiff("s","19-Aug-04 00:00:00",Injection_AcquiredDate)-DateInjSec)/60 You can see this in the example report below.