11 Replies Latest reply on May 11, 2010 11:55 AM by storywizard

# portal rows total then divide

### Title

portal rows total then divide

### Post

Hello:

I have a portal where I have a column of  figures  that I total, giving me Total Time, then I want to divide that total by another figure, not a calculation field.My portal row is totaled using a caculation field.

This is how I get to the total of my tme fields.

Field in zTasks called : Amount (text field)

Field in zTasks called : TotalTime (Summary Field)

I cannot figure out how to start from the initial data in the portal rows, total them then divide by another field, which is not a calaculation field.

Hope that is clear...

S

• ###### 1. Re: portal rows total then divide

What field do you wish to divide by? Amount? If so, that field should be a number field rather than text.

Your calculation would then look like this:

zPages / Amount

if I understand your post correctly.

• ###### 2. Re: portal rows total then divide

Hi Phil:

so I can take the total from a calculation field and divide it?  OK...

I have to say I got confused trying this I will give what you sugget a go...wish me luck...

thanks again..

S

• ###### 3. Re: portal rows total then divide

hmmm, I get a zero(0) in the field...

must be close though...

Story

• ###### 4. Re: portal rows total then divide

You can refer to calculation fields in other calculation expressions just as though the fields are data fields of the same type as the calculation field's specified return type.

You could also modify your zPages calculation to be:

The only difference is whether you also need the portal total in addition to the this calculated result.

• ###### 5. Re: portal rows total then divide

this time I get a very small fractions and the odd question mark...we are nearly there...:-)

S

• ###### 6. Re: portal rows total then divide

The field should be number--not text. Don't know if that was a factor.

The two most common reasons for a "?" are division by zero (or an empty field) or the field is too narrow to display the value. You can check to see if the field width is too small by clicking or tabbing into the field while in browse mode. If the field is too narrow, the actual value will pop up while your cursor is in the field and then revert back to a question mark when you exit the field.

You can fix the field width problem by making the field wider and/or by formatting the number differently in the inspector or object info pallet.

• ###### 7. Re: portal rows total then divide

This part makes no sense:

storywizard wrote:

Since the two fields are in the same table occurrence, the result of zPages will be equal to the value of TimeSpent (in each record).

• ###### 8. Re: portal rows total then divide

Yes, you are quite right, I had an error in my calculations, not sure how I came up with that...

I have fixed that, now will try Phil's suggestion..

Story

• ###### 9. Re: portal rows total then divide

tried Phil's solution  TotalPages /TotalTime

works perfectly

just one more thing, how does one limit the decimal result to 2 places?

Story

• ###### 10. Re: portal rows total then divide

You have two options and it's up to you to decide which is the better option:

You can format the field on the layout to just have two decimal places.

You can modify the calculation to be:

Round ( TotalPages /TotalTime ; 2 )

If this field is used in other calculations, the unrounded value will be slightly more accurate--don't use the round function.

• ###### 11. Re: portal rows total then divide

Great Stuff..

Thanks so much for your patience and help over tha last day or so, I have just been thown in to the Filemaker fray again as my boss wanted some updates to the solution I created last year, I have not been doing much lately, so the curve has been vertical in some ways...

thanks again,

all the best,

Storywizard