Jump to content

Summary Average Table with Portals


This topic is 1414 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi Guys, 

I have two tables: 

- Companies (with Company Data)

- Transactions (with Transaction Data)

The Company ID (serial number) is liked to Transaction via a Foreign Key. So all good. 

I have a layout on the Companies Table, where I then have a Portal that lists transactions relating to that company only. Again, so far so good. 

Now, in the Transactions Table there is a number calculation/number, the Field is called Percentage Increase. 

What I want to do is in the Company Layout view have a field which is a Summary of the Percentage Increases. So if there are 5 records, the average would be over 5. 

In the Transactions Table I have made a Summary 'average of' this field. 

What I hoped would happen is by adding this field, it would give me my average in the Company Layout. 

Suffice to say it hasn't!

I guess I've done something wrong, or maybe even put the calculation in the wrong Table? 

Can anyone help :)

Thanks!

Neil 

  

 

 

Link to comment
Share on other sites

2 hours ago, Neil Scrivener said:

in the Transactions Table there is a number calculation/number, the Field is called Percentage Increase. 

How exactly is this Percentage Increase field defined?

 

2 hours ago, Neil Scrivener said:

What I hoped would happen is by adding this field, it would give me my average in the Company Layout. 

Could we have a worked out example? For example, transaction records (of the same parent):

Value Change
100  
105 5.0%
115.5 10%

Average change: 7.5%

Is that what you would expect?

 

2 hours ago, Neil Scrivener said:

Suffice to say it hasn't!

No, it does not suffice. It would be much more helpful to know exactly how it failed - e.g. the result was wrong, there was no result, there was an error, or ... ?

 

Link to comment
Share on other sites

Hi, 

The Percentage Increase Field is a Calculation Field. The Calculation is NumberCurrent/NumberPrevious -1. 

The field is operating fine.  

Correct on your table above, this is the answer it should give. 

When inserting the Field into my Company Layout view, it shows nothing. No figure, absolutely nothing. 

Does that help at all?  

Link to comment
Share on other sites

Haha, the wonders of the internet. 

I've knocked up the attached Demo File. 

In my actual DB, the Portal in Companies lists the transactions - not sure why it's not working in this? 

But you can see in the Companies Layout (hopefully) what I'm trying to get, in the Average Increase/Decrease Field? 

Thanks!

N

Demo File.fmp12

Link to comment
Share on other sites

13 minutes ago, Neil Scrivener said:

In my actual DB, the Portal in Companies lists the transactions - not sure why it's not working in this? 

Because you are populating the CompanyIDFK field with the company's name, instead of the company's ID. Thus none of the transactions are related to any company. Once you fix that, the records become related, the portal shows them and the summary field displays the correct value.

 

Demo File+.fmp12

Link to comment
Share on other sites

Thank you for this, adjusted in my Demo Database and all working good. 

So, having performed the equivalent calculation in my actual database, I am getting the following information: 

Company A

Percentage Difference - Year 1 25.81%
Percentage Difference - Year 1 21.37%
Percentage Difference - Year 1 17.45%
Percentage Difference - Year 1 4.49%

Average Difference: 2,616,075.00%

So this seems to be taking an average of the entire table of data, and not 'filtering' it by the Company record that I'm in. 

Any views what could be wrong? 

Thanks!

UPDATE I've added the field to Transaction Data layout and getting a figure of 23,215,055.28%!

Now I'm really puzzled?!

UPDATE to the UPDATE, Ive changed the calculation to a "Total Of" instead of Average of, and it's giving me 69.11% - which is the above percentages added......so something is working!

Update to the update to the update: have now switched it back to Average Of, and by some magic it's working. Possibly I bug, not sure?!

Edited by Neil Scrivener
Link to comment
Share on other sites

This topic is 1414 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.