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

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

Coverting this query

Started by cognosryan, 24 Mar 2015 11:26:13 AM

Previous topic - Next topic

cognosryan

Hi everyone,

Wondering if you could help me.

I need to remove this from Data Manager and put this as an item into a fact table in framework manager.

Ive tried a number of different ways but i'm struggling to get the correct syntax.

This is the calc that needs to work in FWM.

( ToTime( ACTUAL_TASK_START_TIME, 'HH:MI:SS')  , ToTime( ACTUAL_TASK_FINISH_TIME, 'HH:MI:SS') )/60;

Any ideas would be most welcome.

Thank you  :)

Ryan


MFGF

Quote from: cognosryan on 24 Mar 2015 11:26:13 AM
Hi everyone,

Wondering if you could help me.

I need to remove this from Data Manager and put this as an item into a fact table in framework manager.

Ive tried a number of different ways but i'm struggling to get the correct syntax.

This is the calc that needs to work in FWM.

( ToTime( ACTUAL_TASK_START_TIME, 'HH:MI:SS')  , ToTime( ACTUAL_TASK_FINISH_TIME, 'HH:MI:SS') )/60;

Any ideas would be most welcome.

Thank you  :)

Ryan

Hi,

This doesn't appear to be complete syntax. Did you miss off the beginning of the expression? It looks like there might be a function call that is expecting the two time values as arguments? What is this function?

The ToTime function in Data Manager says the following:

ToTime( value [, format] )
Either converts a string  (of optional 'time format') to a time or 'time in time zone'; or a number (representing seconds from midnight) to a time. If no format is specified, 'hh:mi:ss.fffffffff stzh:tzm' is assumed.


What is ACTUAL_TASK_START_TIME and what is ACTUAL_TASK_FINISH_TIME? Are they strings? Numbers? Can you provide examples of what they contain?

MF.
Meep!

cognosryan

Hi MF,

Apologies i did miss of the first part:

SecondsBetween( ToTime( ACTUAL_TASK_START_TIME, 'HH:MI:SS')  , ToTime( ACTUAL_ASS_START_TIME, 'HH:MI:SS') )/60;

ACTUAL_TASK_START_TIME and ACTUAL_ASS_START_TIME contain times in the format of hours.minutes, and seconds such as> 12:08:00

Thanks

Ryan

cognosryan

MF,

Not to worry now i was playing around and found a solution.

I casted both the times as a timestamp:
cast( [Actual Ass Start Time], TIMESTAMP )

and created another item with a a simple subtraction: got the correct output.

"2 hours 2 minutes"

Cheers

Ryan

MFGF

Quote from: cognosryan on 25 Mar 2015 06:45:37 AM
MF,

Not to worry now i was playing around and found a solution.

I casted both the times as a timestamp:
cast( [Actual Ass Start Time], TIMESTAMP )

and created another item with a a simple subtraction: got the correct output.

"2 hours 2 minutes"

Cheers

Ryan

Hi,

Ah - ok - you managed it. Great!! :) It really depended on what was in ACTUAL_TASK_START_TIME and ACTUAL_ASK_END_TIME as to whether we could just recast them directly or if we needed to extract each part and assemble them into a time we could then cast. Looks like it worked out to be the simplest option for you. The result of the subtraction you see now is what is called an "interval", and it defaults to the format you show here.

Thanks for the update - it might be very useful to others facing a similar challenge.

Cheers!

MF.
Meep!