Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Begging for help with summary formula

Status
Not open for further replies.

pnetgal

Technical User
Dec 13, 2002
2
US
Forgive me if this is addressed in the FAQ, but I didn't see anything that addressed coverting a string to currency formula with summary.

I'm having trouble getting a forumula to summarize -- here's the scoop . . . I have a field that is a user-defined field, considered to be a "string". I'm using this UDF for a unit price. In order to get the amount spent on an order, I came up with the following formula:

Ccur({icm.udf1}) * {invhist.qty}

This works great -- for just the first transaction only. If I have Location A making multiple purchases during a month, this formula only picks up the first transaction. So, I tried to sum all the month's transactions for that area. But, it fails saying it cannot produce a running total for that field. I tried:

SUM (Ccur({icm.udf1}) * {invhist.qty})

Can anyone figure out why it won't summarize this formula?? Is it because I'm converting from a string to a currency (which is want I need)?????
 
if it is grouped by month, your formula should look like:

(Sum(Ccur({icm.udf1},yourdatefiled))) * {invhist.qty}

I think is it. If not provide more info.

ro
Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
It's grouped by location and account code . . . I'm running the report for a specified date range, but it's not grouped by date.

Maybe this will help: Say during the month of November, I have (5) locations I want to report on. Rather than see every single transaction for every location, I want it to look like:

Location A $10,000
Location B $ 5,000
Location C $13,000 etc.

To get the $ for Location A for the month, I needed to take the quantity * the price, which, unfortunately, was put into a UDF, which I have no control to change the format of. It's designated as a string, and a string it must remain. (I cannot touch the source code of this particular software). This is why I needed to convert it, but it's only recognizing the very first transaction for each location, which is why I needed to summarize.

Does this make sense??
 
Dear pnetgal,

What would be helpful here is to see more data. I can see what you want but I need to see the layout of your report and what is in the details. Example:

GH1 Location
GH2 Account Code

2,250 Qty (2)
5,000 Qty (1)
---------------------------
10,000 3
{icm.udf1} (you say this field is a string?)

I am trying to get an idea of how this goes. If the icm.udf1 field was a number I would create do this:

Your formula:

Ccur({icm.udf1}) * {invhist.qty} is placed on the detail line and then you click it and choose Insert Summary, Sum, by Group Location.

Multiplying the quantity by the Sum doesn't make sense to me because each "line item" can have a different quantity and cost.

Try that and let me know if it works.

Ro Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Gee pnetgal ,

wish I could help, but it's just a bit ambiguous...

Anyway, are you grouping your report correctly, as this would be a basis to get of a work-around just in case there is a problem with your UDF method. Bored Crystal Guy Looking for Problems to Solve...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top