Trouble IMPORTING if Attribute Type is DURATION

If you think that something doesn't work in Aware IM post your message here
Post Reply
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Trouble IMPORTING if Attribute Type is DURATION

Post by ab042 »

I have an Attribute type of DURATION with a FORMAT of HH:MM

I'm trying to IMPORT something into thisBO / attribute and it will not work.
I've tried just about ever possible option with different formats and nothing appears to work

The current import file looks something like this and headers are in place.

Item1,Description1,01:00
Item2,Description2,00:00
Item3,Description3,9:00

The Attribute that is a DURATION always imports blank or 0:0

Any suggestions?
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

Bump, any suggestions on this PLEASE.

I've also tried importing a TIMESTAMP attribute and it does imports correctly but I can't figure out a rule to get the TimeStamp into a duration attribute.

A simple: DurationAttribute = TimestampAttribute doesn't work and nothing else I've tried works?

Any suggestions. I'm imported data and need the duration attribute so that I can do calculates on it in my app.
tford
Posts: 4238
Joined: Sat Mar 10, 2007 6:44 pm

Post by tford »

ab042,

I'm sure support has a better solution, but I wonder if you could import that info as text, then do conversions inside Aware to get the info into the proper time formats ???

Tom
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

One possible reason is that you do not indicate the duration format in the header of the import file.
Aware IM Support Team
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

I feel so stupid but I can't find documentation or a sample of an import that uses formats in the import header anywhere.

When I try using normal arithmetic type operations I can't get the import to accept the header. How would one go about creating a format in the header?

Could you give me a very simple sample, please?

Thanks
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

It's the name of the attribute followed by space and then the format, for example:

MyObject.Duration HH:mm
Aware IM Support Team
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

Support is it possible there is a bug in a duration attriubte. There is several issues that I've found using a duration attribute.

#1) When I define the format as HH:MM and place 03:00 in it. It shows on the form as 3:0 doesn't even look like hours and minutes.
#2) The example you gave was HH:mm and that doesn't appear as a format option for duration. However, I also tried it and it shows as 3:mm if I key something on a form.
#3) I've tried HH:MM and HH:mm in the import file as well as many other options. Regardless nothing imports into the duration attribute.
#4) Something else I've tried was to import the 03:00 into a TimeStamp and that works.
However when I create a rule to get the time into the Duration attribute it doesn't work. ie: DurAttribute=TimeStampeAttribute

I have a duration attribute with the HH:MM set as format.
I can not get a simple time such as 03:00 (3 hours 0 minutes) to import into a duration attribute and I need it bad. Any suggestions would be appreciated.
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Can you try to make it a timestamp attribute instead of duration and use the HH:mm format for the timestamp?
Aware IM Support Team
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

NO, I must have a duration because I'm calculating time across dates down to the minute.

Please note the 2nd post that starts with "Bump, any suggestion"
In that post I talked about the TIMESTAMP PROBLEM.

Any suggestions on how to get a rule to get a timestamp into an duration attribute and I'll create a rule like I talked about in my 2nd post.

Thanks
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

This is how you can do it. The idea is to subtract two timestamps - one is the one you got and another one created for the same day but at 0 hours and minutes, so the difference will be the required duration:

Object.Duration = TIMESTAMP (1, 1, 2008, HOURS (Object.Timestamp), MINUTES (Object.Timestamp)) - TIMESTAMP (1, 1, 2008, 0, 0)

where Object.Timestamp is the timestamp obtained after import. The day, month and year can be anything but they have to be the same in both timestamps.
Aware IM Support Team
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

The above does not work.

I've spent no less than 6 hours on this issue and it shouldn't be this complicated. Importing a Duration should work and when it doesn't you should be able to create a TimeStamp, Import into it and create a simple rule for the duration attribute: Object.Duration=TimeStampObject

Using your logic below the log shows DurationAttrib=0:0

Using a simple TestDuration=CURRENT_TIMESTAMP, and it shows TestDuration=null

I even tried using your statement above and replacing the two 'Object.Timestamp' in it with '18:15' and also '18:15:00' and they also return TestDuration=null

Thanks for your continued input, but nothing appears to be working. Any other suggestions?
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Sorry, my mistake. In the expression of the previous post use HOUR function instead of HOURS and MINUTE instead of MINUTES.

IT WILL WORK.
Aware IM Support Team
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

And it does work and I thank you !!!!!!!!

Please add these bugs to your future version list so we can use a simple "duration = time" and the import into a duration should also work at some point. Could you also put on your list to get the duration time to look like a time and not a goofy number.

Current if you have an attribute that is HH:MM and key 03:00 for 3 hours it shows as 3:0 .
Not what a client wants to see when they expect it to be hours and minutes.

Thanks again for staying with this, my immediate problem is solved.
rocketman
Posts: 1252
Joined: Fri Jan 02, 2009 11:22 pm
Location: Preston UK
Contact:

Post by rocketman »

Hi,

I know it's a year on from the original post - but if any new users are reading this thread, just thought you'd like to know that The import of durations in V4 Build 1151 works fine PROVIDED that your Durations are in Milliseconds.

I had to do a bit of data massaging in Microsoft Excel to get it to work so 4 hours became 14,400,000 (minus the commas. Thats:

(((hours * 60) +Minutes) * 60) +seconds) *1000

Form formatting is still wrong though. with an attribute setting of HH:MM, a duration of 1 hour 5 minutes presents in the form field as 1:5

I would expect 01:05. (Any chance in the next build please)
Post Reply