Showing posts with label sum. Show all posts
Showing posts with label sum. Show all posts

Thursday, March 29, 2012

Formula Help

I have a report that I need to take the average of a total(s)...
For example
I have a field that is a sum of units(number) and then I have a field that is a count of payments(number). I need to average these two fields,so that I have the average # of payments?How can I do this?I would try creating a new formula and expand the "REPORT FIELDS" in the tree within the formula editor (2nd one from left) and pull the applicable summary fields in. I'm not positive that would work as I haven't tried it before.|||I've tried that but it gives me an error of

The Summary/Running Total field cannot be created.|||I just tested it in a report I have and it worked just fine. Where are you trying to use it? You will not be able to use it in the details, but it would have to fall in the same group footer as the summary.|||These calculations are in the group footer. I need to average the grand totals.

What formula are you using? These are the two fields that I need to use

(Sum ({CLCHARGE.CUNITS}, {CLPAYMNT.COMPANY}) and
Count({CLPAYMNT.CHGID},{CLPAYMNT.COMPANY})|||Sorry I didn't ask this in the previous post, but what version of CR are you using? I am on 10, so if you are earlier, maybe it doesn't support those calculations in the same way it does for me. If you are 10 or XI, then I would need to ask - did you create formulas for the summaries or did you use the INSERT / SUMMARY from the menu bar? If you created the summaries by letting CR do it via the INSERT / SUMMARY, then you create a separate formula that drags those summaries in to the formula editor (typing a "/" between them), it should work.|||I am using 8.5|||It may be that you can't do it from 8.5. I'm sorry that I couldn't help you.|||I was afraid of that...Thanks for you help anyway.|||Hi there I have an average formula setup in one of my reports using CR 8.5.

whileprintingrecords;

numbervar TotalTsec;
local numbervar AverageFix:=TotalTsec/DistinctCount ({SW_CASE.swCaseId});
numbervar LenOfDay;

Hope this points you in the right direction !

Many Thanks

Sunday, February 19, 2012

Format a number for use as number in Excel

I want to format a number like "#,##0.00" in order to handle it in Excel as a number (i.e. compute a sum).

Excel is able to show a number in a specail format and still allow to compute with ...

Thanks in advance,

Peter

What problem are you having? If you have #,##0.00 set as your format code, you should be able to export to Excel and then do a sum on that column.

Jarret

|||

It doesn't work in my Excel neither with 1 value nor with many values - the sum is 0 anytime.

Peter

|||

I found this on another post (http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1072895&SiteID=1):

Apply formatting using N in the Format property, then in the value textbox, apply an explicit cast of the value. E.g.

=CDbl(Fields!Example.Value)

Hope this helps.

Jarret

format

Hi,
select SUM(CommAmt * (1 - Disc/100.00)) AS Comm from mytbl return:
24.6199951171875
how to format it so it will only return two decimal? Thanks.CONVERT(DECIMAL(5,2), expression)
"js" <js@.someone@.hotmail.com> wrote in message
news:O$0z8W9tFHA.1032@.TK2MSFTNGP12.phx.gbl...
> Hi,
> select SUM(CommAmt * (1 - Disc/100.00)) AS Comm from mytbl return:
> 24.6199951171875
> how to format it so it will only return two decimal? Thanks.
>
>