Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

In my Invoice file I have an Order Entry layout with a line items portal called “Inv_LineItems_InvID. This portal has a Yes/No vote field as shown below.

Vote: Relationship Inv_LineItems_InvID (Line Items TO) Related to Invoices TO OrderNbr = OrderNbr.

I also have the following fields that gives me the number of Yes votes, No votes and total votes. As shown below.

scount: Summary = Count of Vote (Line Items TO)

syes: Summary = Total of Vote (Line Items TO)

cNo: Number Calc = GetSummary ( sCOUNT ; ProdId ) - GetSummary ( sYes ; ProdId ) Relationship (Inv_LineItems_Constant (Line Items TO)

What I need is after a customers votes on a product they are able to see how their vote compares to others. So they vote YES on #22337 Antique Fire Truck and after they vote they can see that 76% Voted YES.

I know this is not an easy question because I’ve posted it before with no resonse. But if one of you read this and see what I need to do I would really appreciate your help. This is the last part of my project and I’d sure like to get it over with.

Thanks,

Milo

Posted (edited)

I would find it easier to help if you had a file containing the basic elements. Sure this would probably take 10 minutes to put together but i'm sure you will get a quicker result and it would be easier than me doing it and getting it wrong.

Edited by Guest
Posted

Hi Stuart,

I'd like to post it but my boss doesn't want me putting it on an open forum. What do you think about my sending it directly to you? I understand if that's not what you want, it's just the only option I have.

Milo

Posted

Hi Milo,

I can understand the boss's concern about posting it on the Forum. Most developers in your position will do one of two things.

Save a clone of the file (and put in a few generic records).

Create a demo of the file and post that.

If you have confidential data, or concerns about proprietary file structure, then the demo file is the base way to show your problem. Posting it here will allow more of us to review your file and suggest help.

Sending it back channel, should be avoided, and you really haven't accomplished what the boss is concerned about, unless you have Stuart sign a NDA.

HTH

Lee

Posted

Be sure to [color:red]Zip the file.

Next, Use the Reply Button in my post, or the Edit Button of your own post.

When the New Reply box opens, or the Edit Box opens,

Go to the bottom of the Page

click on [color:orange]Manage files

click on Browse, locate your file and choose it,

Click on ADD File, you will see the file being loaded,

Click on Finished.

Add Post

HTH

Lee

Posted

Hi Guys,

Since I've had no response I just wanted to ask the question. Is it because it's a tough calculation to design or is it due to poor design of the file?

I sure hope it's the former and not the latter!

Milo

Posted

Not sure how much sense this will make but...

Create a new Line_Items table occurance, relate it to itself via FkProdId - call this new TO, Line_Items_LiveVote or something.

Now, go to your table definition, create a new calc field called c_votes_yesCount. Set the calculation = Count(Line_Items_LiveVote::Vote) and make sure that it is evaluating from the context of Line_Items.

For c_votes_noCount, do the same thing, but set your calc to Count(Line_Items_LiveVote::FkProdId) - c_votes_yesCount.

I hope I'm not completely off in this response.

Posted

Hi Genx,

Create a new Line_Items table occurance, relate it to itself via FkProdId - call this new TO, Line_Items_LiveVote or something.

I do not know what you mean by "relate it to itself"? Do you mean to set up an = relationship between your new table and the Line_Items TO? That's what I did and nothing is shown in either field. Did it work when you tried it in the file I uploaded?

Milo

Posted

Hi Genx,

I must not have explainted myself very well. It looks like what you did I already have, which is the total number of votes per item, and then the breakdown by Yes and No's.

[color:blue]What I need is after a customers votes on a product they are able to see how their vote compares to others. So they vote YES on #22337 Antique Fire Truck and after they vote they can see that 76% also Voted YES.

Thanks Genx,

Milo

Posted (edited)

... right, but your summary fields only work in a report, if you look on your Invoice Entry layout, its live - If you want an actual percentage, then just change the yes calc to be:

Sum(Line_Items_VoteCount::Vote) / Count(Line_Items_VoteCount::FkProdId) * 100

and the no calc to be:

(Count(Line_Items_VoteCount::FkProdId) - c_votes_yesCount) / Count(Line_Items_VoteCount::FkProdId) * 100

If you want to show the percentage that voted inline with that user, then just make a new calc field called c_votes_sameVote: If( Vote ; c_votes_yesCount ; c_votes_noCount )

Edited by Guest
Posted

Hi Genx,

Oh yes, how sweet it is and the percentages work great! Two things maybe you could help me with.

1. The percentages show like 8351.33% how can I get it to round like 83.5%

2. We defiantly want the "c_votes_yesCount" and c_votes_noCount because, as you said, it gives us live information without the need of preview mode. But we do not want the customer to see the actual number of votes. We just want them to see the percentage. Right now c_votes_yesPercent is [color:red]"Sum(Line_Items_VoteCount::Vote) / Count(Line_Items_VoteCount::FkProdId) * 100" and it only works in preview mode. Is there a way to get it as live information to show in the portal like you have "c_votes_yesCount"?

Thank you soooooo much for what you've already done Genx you and others as well have been such a great help and what you've given has been such a great learning tool.

Milo

Posted

1) Right click the field > Number format -- then just set it up to be limited to 2 decimals.

2) The calculation that you ahve there should show perfectly fine in browse mode. Ensure that you are using the same context table occurance (in the drop down at the top of the calc define window) and that you have sourced the field from the same table occurance on the layout.

Posted

Hi Genx,

Yes Sir, how right you are it works perfectly.

Regardng how the percentages show. I have it set as a Number formatted as,

Fixed number of decimal digits: 2

Use notation: Percent

and I get 8333.33%

Milo

Posted

Hi Comment,

That did it! Thank you all so much not only for your help, but your willingness to continue even after our really dumb questions and the equally stupid things we do.

You guys are the best and I only say it because it's true!

Milo

Posted

I can't recall what questions I asked when I was starting out with FM, but I'm sure Michael would testify that you could classify a lot of them as "dumb".

We're all new to something at some point in our lives, and I'm sure you'll be an FM Guru like Comment in no time ;)

Posted

Maybe you guys wouldn't mind helping me on this calculation one more time. I just noticed that if there have not been at least 1 YES vote and 1 NO vote the the field shows "?". Is there a way to set it up so for example there are 5 yes votes and 0 no votes that YES will show as 100% and NO shows 0%?

Thanks,

Milo

This topic is 6293 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.