Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: String to Date, then Conditional Division? Post Reply Post New Topic
Author Message
nathanielban
Newbie
Newbie
Avatar

Joined: 10 Sep 2010
Location: United States
Online Status: Offline
Posts: 5
Quote nathanielban Replybullet Topic: String to Date, then Conditional Division?
     Posted: 10 Sep 2010 at 10:47am
Im pulling information from an access database, and for some wonderful reason the developer decided to code it so that the value for elapsed total time, was stored as a string in the format DD:HH:MM. What I'd like to do is show the percentage of items with a value under 30 minutes. IE there are 10 tickets, 9 of them were completed in 30 minutes or less, so 90%. I for the life of me cannot figure out a way to do this.

Edited by nathanielban - 10 Sep 2010 at 10:48am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 10 Sep 2010 at 11:15am
do a count of all records
create a formula field as "Under30" to count the under 30 minutes...
if left(field,5)="00:00" and tonumber(right(field,2))<30 then 1 else 0
create a formula field to get your %
SUM UNder30 and divide by the total as
IP IP Logged
nathanielban
Newbie
Newbie
Avatar

Joined: 10 Sep 2010
Location: United States
Online Status: Offline
Posts: 5
Quote nathanielban Replybullet Posted: 10 Sep 2010 at 11:41am
I've left the office for the weekend but I'll try this Monday morning.
IP IP Logged
nathanielban
Newbie
Newbie
Avatar

Joined: 10 Sep 2010
Location: United States
Online Status: Offline
Posts: 5
Quote nathanielban Replybullet Posted: 13 Sep 2010 at 2:10am
This is becoming more of a pain than I originally anticipated.

This is what the data I'm working with looks like:


Ideally, I'd be able to show a total of all of the time used, then a % of ticket times that were under 30 minutes total. The software we are using is, to be frank, TERRIBLE. It's an older version of Track-IT and it does things slowly, if at all. Ideally that field would be in DD:HH:MM but in the event it's a single digit, it doesn't pad the zero.

As always, any help would be appreciated.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Sep 2010 at 5:17am
just change the formula I gave you to use the formatting in the db
 
if left(field,3)="0:0" and tonumber(right(field,2))<30 then 1 else 0
IP IP Logged
nathanielban
Newbie
Newbie
Avatar

Joined: 10 Sep 2010
Location: United States
Online Status: Offline
Posts: 5
Quote nathanielban Replybullet Posted: 13 Sep 2010 at 6:40am
I hate to be a bother, this program seems to do things contrary to anything I've used in the past. I also may be completely missing the point.

Is this along the lines of what you were saying?

Global NumberVar Over30;
Global NumberVar Under30;
if left({TASKS.ELAPSETIME},3)="0:0" and tonumber(right({TASKS.ELAPSETIME},2))<30 then Over30 = Over30+1 else Under30 = Under30+1;

I'm going to keep crunching at this, I haven't had to use this program in years, and it's unfortunately showing quite badly. The syntax just isn't up in my head anymore.

Edited by nathanielban - 13 Sep 2010 at 6:43am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 13 Sep 2010 at 7:16am
no problem.
you can go the route you were heading with creating multiple ahsred variable formulas but IMO the easier solution here is to just creat one formula (call it Uner30) that will return a 1 or a 0...
if left(field,3)="0:0" and tonumber(right(field,2))<30 then 1 else 0
 You can place it on the detail section to validate it is 'counting' correctly for under 30 minutes. Once validated just insert a summary on it as a SUM ...
SUM({@Under30})
IP IP Logged
nathanielban
Newbie
Newbie
Avatar

Joined: 10 Sep 2010
Location: United States
Online Status: Offline
Posts: 5
Quote nathanielban Replybullet Posted: 13 Sep 2010 at 7:34am
Thank you for spelling it out for me, it's been a rough morning. I really appreciate the help.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum