COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Report Studio => Topic started by: v2k4u on 06 Apr 2015 09:53:20 AM

Title: How to get rid of seconds in a datetime function
Post by: v2k4u on 06 Apr 2015 09:53:20 AM
Hi Gurus,

I have a quick question on how to get rid of seconds from a datetime function so that i can group the datetime until Min.

For ex:
     Current Date                              Expected Date
2014-01-01 19:20:25                2014-01-01 19:20

Thanks,
Vinod kumar.
Title: Re: How to get rid of seconds in a datetime function
Post by: Joker on 07 Apr 2015 12:07:35 AM
Hi,

Go to:
Data Format->Format Type(date/time)-->Properties-->Display Seconds->'No'

Regards,
Joker
Title: Re: How to get rid of seconds in a datetime function
Post by: v2k4u on 07 Apr 2015 10:45:57 AM
I tried doing the same but the grouping doesn't work properly if i do as stated below.

I also have a requirement to group all the timings together if they are just having 2 different dates with the seconds being different.
Title: Re: How to get rid of seconds in a datetime function
Post by: bdbits on 07 Apr 2015 10:48:24 AM
What Joker said will take care of it from a display perspective, but will not change the underlying values. If you actually want to get rid of the seconds, you need a data item based on an expression. Then you use the data item for grouping. But you have not provided enough information for anyone to help with the syntax for the expression. For example, what function are you using? What kind of data source do you have, and what is the model type (dimensional, relational, etc.).