COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: superdesi on 27 Nov 2017 08:28:20 PM

Title: Time passed between multiple values in a data item
Post by: superdesi on 27 Nov 2017 08:28:20 PM
I have a data item that returns multiple date values based on how long a person has worked in a certain department.  I want to calculate how long that person has stayed in that department before moving on.

(https://uploads.tapatalk-cdn.com/20171128/53bf43df5cac93c1804bfd9dd90bf922.jpg)

In the above example I want to calculate months between July and November.....and then November and January....and so on.

If the data item "Date" returned one date at a time, I know how to go about that......but this multiple value has me stumped.

Thanks in advance.

Title: Re: Time passed between multiple values in a data item
Post by: New_Guy on 28 Nov 2017 08:25:45 AM
Hi,
Easiest way will be section the list by Employee and sort ascending by Date and use running-difference([Date]) and derive the days or months from it. Another way is to create a function and import it and then use it in the report.
Good luck
New guy 
Title: Re: Time passed between multiple values in a data item
Post by: superdesi on 28 Nov 2017 01:02:19 PM
Quote from: New_Guy on 28 Nov 2017 08:25:45 AM
Hi,
Easiest way will be section the list by Employee and sort ascending by Date and use running-difference([Date]) and derive the days or months from it. Another way is to create a function and import it and then use it in the report.
Good luck
New guy
Thanks for the tip on sectioning it.  Didn't think of that.

However.....i have no clue on creating a function.  Thanks again.