If you are unable to create a new account, please email support@bspsoftware.com

 

How to show a range of minutes from an hour of a specific day in the line graph?

Started by andregomes, 07 Oct 2016 10:30:34 AM

Previous topic - Next topic

andregomes

Good morning people,

In the report studio, I need to show a line graph where the time axis shows the time in 15-minute intervals and the metric axis of the amount of a record.

How to do this ?

I have a datetime = 'YYYYMMDD - hh: mm: ss' attribute

a prompt with DAY selection to filter the graph and present hypertext links time with the interval of 15 minutes.


I do not know how I will do this interval.

example

8:00 p.m. to 8:15 p.m. - 8:30 p.m. to 8:45 p.m.

Thank you very much.

Lynn

Quote from: andregomes on 07 Oct 2016 10:30:34 AM
Good morning people,

In the report studio, I need to show a line graph where the time axis shows the time in 15-minute intervals and the metric axis of the amount of a record.

How to do this ?

I have a datetime = 'YYYYMMDD - hh: mm: ss' attribute

a prompt with DAY selection to filter the graph and present hypertext links time with the interval of 15 minutes.


I do not know how I will do this interval.

example

8:00 p.m. to 8:15 p.m. - 8:30 p.m. to 8:45 p.m.

Thank you very much.

Is this a relational package? Assuming it is, you can extract the hours and minutes from the date/time field to construct a data item reflecting 15 minute segments.

This expression extracts the hour from your date/time field and casts it to a string:

cast ( extract ( hour, [Your Package].[Your Query Subject].[Your Date/Time] ), varchar(2) )


This expression extracts the minutes from your date/time field and evaluates it within a case statement to determine the appropriate 15-minute segment. The string that appears in the "then" for each expression reflects the label you'd want to see on

case
when extract ( minute, [ESSential Jobs].[Job Details].[Job Raised Timestamp] )
          between 0 and 15
   then ':00 to :15'
when extract ( minute, [ESSential Jobs].[Job Details].[Job Raised Timestamp] )
          between 16 and 30
   then ':16 to :30'
when extract ( minute, [ESSential Jobs].[Job Details].[Job Raised Timestamp] )
          between 31 and 45
   then ':31 to :45'
when extract ( minute, [ESSential Jobs].[Job Details].[Job Raised Timestamp] )
          between 46 and 59
   then ':46 to :59'
end


If you concatenate those two elements together you'd end up with something like "10:31 - :45" for a time stamp that reflects 10:37, for example.

Of course you can have an expression for the start and for the end minute band in order to produce "10:31 - 10:45", so consider my expressions as illustration of a concept that you can apply in any way that suits.

andregomes

Hello,

I did it this way:

case  when (extract(minute; [AtributeExemple].[Date/hour) < 15 )   
then to_char([AtributeExemple].[Date/hour; 'HH24') || ':15'
when  (extract(minute; [AtributeExemple].[Date/hour) < 30)
then to_char([AtributeExemple].[Date/hour; 'HH24') ||':30'
when  (extract(minute; [AtributeExemple].[Date/hour) < 45) 
then to_char([AtributeExemple].[Date/hour; 'HH24') || ':45'
else  to_char( _add_hours([AtributeExemple].[Date/hour; 1) ; 'HH24') || ':00'
end

thanks for you help.