Hi Leif,
Based on the following samples (created with a data module):

Note: it is easy to split the time in hour and minute with a data module.
I've created a calculation with the following expression:
count(distinct Minute_ for Hour_)
Change Aggregate to "None".
Then, if you try a dashboard, you will have:

Best regards,
------------------------------
Patrick Neveu
Positive Thinking Company
------------------------------
Original Message:
Sent: Mon May 09, 2022 02:20 PM
From: Leif Glaes
Subject: Extract hour:Minute from timestamp
Hi!
Thank´s, I will try the different suggested solutions
What I forgot to write in my question is that I´m using the solution in a Dashboard. I don´t know if that changes your proposed code-solutions?
I´m trying to get the endtime (how many ends at a certain time) for our surgerys per month, and if I only use hours the result is like this picture below. But I want to catch/get the numbers of surgerys that end following the minutes too, that is to say I want to show how many that ends 16.32, 16.45, 17.12 and so on...
------------------------------
Leif Glaes
Original Message:
Sent: Mon May 09, 2022 09:47 AM
From: HENK CAZEMIER
Subject: Extract hour:Minute from timestamp
Hi Leif,
Did you try substring( '2022-04-12T11:30', 12,5)
If it is a real timestamp field it would include the seconds as well. In which case the following will work:
substring(cast(2022-04-12T11:30:22, varchar(20)), 12, 5)
Using extract function works, but you need to deal with losing leading 0's, e.g. 09:05 gets converted to 9:5
------------------------------
Kind regards,
HENK CAZEMIER
Original Message:
Sent: Fri May 06, 2022 03:47 PM
From: Leif Glaes
Subject: Extract hour:Minute from timestamp
Hi!
How do I do to extract hour:minute from a timestamp of this format:
2022-04-12T11:30
I have been able to get hours with (ex 16, 17..) my current formula:
extract(hour; [Peroptider].[Peroptider].[Tidpunkt] )
But i want to get the combination of hour and minute (like 16:30, 17:25..) from the timestamp - how do i write my formula to get this?
We are using Cognos analytics version 11.1.7
Thank´s in advance
------------------------------
Leif Glaes
------------------------------
#CognosAnalyticswithWatson