Focal Point
[CLOSED] Convert Alphanumeric format to Integer format

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/137103642

September 22, 2009, 03:40 AM
Priya
[CLOSED] Convert Alphanumeric format to Integer format
Hi, I am trying to display time along the Y axis in the format hh.mi .

-SET &ECHO = ALL;
SQL SQLORA SET SERVER OMNI.PERSHING.COM;
SQL SQLORA SET DATETIME ON;

SQL SQLORA

SELECT TO_NUMBER(TO_CHAR(TIME_DURATION,'SSSSS'))AS "metric1",
timestamp AS TIMECOL
FROM OMNI_USER.INTRADAY_VOLUMES_FACT A,OMNI_USER.DATE_DIMENSION B
WHERE (TIMESTAMP,COUNT) IN
(
SELECT TIMESTAMP,MAX(COUNT)
FROM OMNI_USER.INTRADAY_VOLUMES_FACT A, OMNI_USER.DATE_DIMENSION B,OMNI_USER.BUSINESS_DRIVER_DIMENSION_DIM C
WHERE A.DATE_KEY = B.DATE_KEY
AND A.BUSINESS_DRIVER_DIMENSION_KEY = C.BUSINESS_DRIVER_DIMENSION_KEY
AND DRIVER_NAME = 'Intraday ATOMS Orders'
AND TIMESTAMP >= TO_DATE('09/01/2008','mm/dd/yyyy')
AND TIMESTAMP <= TO_DATE['09/30/2008','mm/dd/yyyy')
GROUP BY TIMESTAMP)
AND A.DATE_KEY = B.DATE_KEY;

SQL SQLORA END SESSION;

TABLE FILE SQLOUT

PRINT

metric1/I4


AND COMPUTE
TRANSDATE/YYMD = HDATE(TIMECOL, 'YYMD');
TIMELINE/MDY=TRANSDATE;

AND COMPUTE
-* Below line extracts the HOUR
HOUR/I2 = metric1/3600;
HR_R/I2 = metric1-(HOUR* 3600);
-* Below line extracts the MINUTE
MIN/I2 = (HR_R / 60);
-* Display the Output in HH;MI format
HHMI/A8 = EDIT(HOUR) ||'.'|| EDIT(MIN);
-* Here I want to convert the Alphanumeric format back to Integer format so that I can plot this in the Y axis of the Graph
-* But this line again display only the HOUR part.
HHMI_Int/I7 = EDIT(HHMI);
ON TABLE HOLD AS QOUT
END

TABLE FILE QOUT
PRINT
metric1
HOUR
MIN
HHMI
HHMI_Int
TIMELINE
END

Sample OP:
metric1 HOUR MIN HHMI HHMI_Int TIMELINE
36,000.00 10 0 10.00 10 09/10/08

I need the HHMI_Int to be displayed as an Integer with HH.MI format.
Please let me know if that can be done.

Thanks

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


769
Windows

Using all the above
September 22, 2009, 03:56 AM
Danny-SRL
Priya,
HH.MI cannot be integer, it is decimal.

I suggest you create instead:
  
HHMI_Dec/D7.2c=HOUR + MIN / 100;



Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF