Jump to content

Results of a Yes/No Vote


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

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

... 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
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 ;)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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