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

January 30, 2020, 11:36 AM
rkiran1
[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

This message has been edited. Last edited by: rkiran1,


Version 8.2.03
Output : HTML, Excel & PDF
January 30, 2020, 12:20 PM
Waz
A little more information would help.

What is the format of your field(s) ?

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


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 30, 2020, 03:17 PM
rkiran1
I hope the below details helps.

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
Waz
Can you do a mock up with one of the sample files ?, Still not getting what you are doing.

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


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

January 31, 2020, 09:50 AM
BabakNYC
Bar charts are the default type in InfoAssist. Select the data you'd like to use and drage the Date field to the Horizontal Axis and the Time field to the Vertical Axis. That should give you a starting point for what you want. Now if you can make styling changes and so on.


WebFOCUS 8206, Unix, Windows
March 30, 2020, 08:41 AM
rkiran1
The below code worked for me.
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
David Briars
KR,

Excellent FocalPoint researching and post follow up.

:-)

-Dave




Pilot: WebFOCUS 8.2.06 Test: WebFOCUS 8.1.05M Prod: WebFOCUS 8.1.05M Server: Windows Server 2016/Tomcat Standalone Workstation: Windows 10/IE11+Edge Database: Oracle 12c, Netezza, & MS SQL Server 2019 Output: AHTML/XLSX/HTML/PDF/JSCHART Tools: WFDS, Repository Content, BI Portal Designer & ReportCaster