Focal Point

[SOLVED] Time as measure (y axis) and day as dimension (x axis)

This topic can be found at:

http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9617064296

http://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/9617064296

January 30, 2020, 11:36 AM

[SOLVED] Time as measure (y axis) and day as dimension (x axis)

Hi,My requirement is to have time as measure (y axis) and date as dimension (x axis).

Also how do you take average of time, apart from converting it into seconds.

Any sample is greatly appreciated.

Regards,

KR

Version 8.2.03

Output : HTML, Excel & PDF

January 30, 2020, 12:20 PM

What is the format of your field(s) ?

What version of WebFOCUS are you on ? You should update your signature

Prod: | WebFOCUS 7.6.10/8.1.04 | Upgrade: | WebFOCUS 8.2.06 | OS: | Linux | Outputs: | HTML, PDF, Excel, PPT |

In Focus since 1984 | |||||||

Know The Code |

January 30, 2020, 03:17 PM

1 . We have time/duration HHIS in one field and category in another, we have to take average of time for all category.

Bar graph is the desired output with y axis in time/duration and x axis as category.

2. We have date in YYMD format and want to plot against above time.

Finally the user wants the datatext in ##:## format.

Thanks,

KR

Version 8.2.03

Output : HTML, Excel & PDF

January 30, 2020, 04:24 PM

Have you done a search of Focal Point for, say, "HHIS graph" ?

Prod: | WebFOCUS 7.6.10/8.1.04 | Upgrade: | WebFOCUS 8.2.06 | OS: | Linux | Outputs: | HTML, PDF, Excel, PPT |

In Focus since 1984 | |||||||

Know The Code |

January 31, 2020, 09:50 AM

WebFOCUS 8206, Unix, Windows

March 30, 2020, 08:41 AM

David Briars code from the below link help me solve my issue

Solution

-* File yaxistime.fex -* -* Extract data from database. -* DEFINE FILE GGSALES -* Not part of the technique; create data for testing. NAME/A20 = DECODE SEQ_NO (1 'Francis' 2 'Tony' 3 'David' 4 'Waz'); DATE_START/HYYMDS = DT(2005/12/26 05:45:05.000); DATE_END/HYYMDS = IF SEQ_NO EQ 1 THEN DT(2005/12/26 08:46:06.000) ELSE IF SEQ_NO EQ 2 THEN DT(2005/12/26 07:47:06.000) ELSE IF SEQ_NO EQ 3 THEN DT(2005/12/26 07:47:06.000) ELSE DT(2005/12/26 16:00:00.000) ; END TABLE FILE GGSALES PRINT SEQ NAME COMPUTE MN_DIFF/I9 = HDIFF(DATE_END,DATE_START,'MINUTE','I9'); -* IF RECORDLIMIT EQ 4 ON TABLE HOLD AS HLDTIME END -RUN -* -* Create visualization. -* GRAPH FILE HLDTIME SUM MN_DIFF AS 'Time Spent Studying' BY NAME AS 'Student' ON GRAPH PCHOLD FORMAT JSCHART ON GRAPH SET LOOKGRAPH VBAR ON GRAPH SET AUTOFIT ON ON GRAPH SET STYLE * *GRAPH_JS title: {text: 'Study Hall Report', visible: true}, subtitle: {text: 'Hours:Minutes Spent Studying Per Student', visible: true} *END *GRAPH_JS yaxis: { numberFormat: function(n){ var hours = Math.floor(Math.abs(n) / 60); var minutes = Math.abs(n) % 60; minutes = (minutes < 10) ? '0' + minutes : minutes return hours + ':' + minutes; }, intervalMode: 'interval', intervalValue: 60 } *END *GRAPH_JS series: [ {series: 'reset', tooltip: function(v, s, g) { var hours = Math.floor(Math.abs(v) / 60); var minutes = Math.abs(v) % 60; minutes = (minutes < 10) ? '0' + minutes : minutes var time = hours + ':' + minutes; return 'Name: ' + this.getGroupLabel(g) + '<br/>Time: ' + time;}} ] *END ENDSTYLE END

Version 8.2.03

Output : HTML, Excel & PDF

March 30, 2020, 09:44 AM

Excellent FocalPoint researching and post follow up.

:-)

-Dave