21
Views
7
Comments
Solved
how can get total votes for an attribute in an entity
Question
Application Type
Reactive

Hello

how can get total votes for an attribute(count) in an entity (User Criteria) and then sort the total votes per user in an entity and show the total votes per user in screen (Voting Result)


and then in the screen (Voting Result) in above create funcation to calculaet (The winner is : "Get  User got  highest votes  ")As the in attached example

reactive web

TotalVotes.oml

Rank: #64
Solution

Hi Andrew,


You just have to:

  1. do a WITH OR WITHOUT join with voting;
  2. Group by {User}.[Id] and {User}.[Name] (or whatever are the attributes you need);
  3. Set a Count for voting.{UserId}
  4. Add Order on Count for Descending

For the message, you just need to add an expression showing the winner (the first record in the table since it is ordered by vote count) if the table is not empty:


See OML in attachment.


Kind regards,
João

TotalVotes.oml

Rank: #395

I guess he would also need to make the join with UserCriteria entity, since it have the mapping between user ID and Criteria ID and count to calculate total votes.

Rank: #1861

thanks


Rank: #395
Solution

Hi Andrew,

These 2 are the new attribute columns which has been added into the GetUsers aggregate to show the required results on the votingresult screen. 

Please feel free to ask more questions if you have more questions. :)

Thanks & Kind Regards,

Sachin

Rank: #395
Solution

Hi Andrew,

Please refer the attached OML for the solution. Kindly look into this and let me know, if you need any help.

Thanks & Kind Regards,

Sachin

TotalVotesSachin.oml

Rank: #1861

How to add these yellow umbrella elements

element.JPG

Rank: #395
Solution

Hi Andrew,

These 2 are the new attribute columns which has been added into the GetUsers aggregate to show the required results on the votingresult screen. 

Please feel free to ask more questions if you have more questions. :)

Thanks & Kind Regards,

Sachin

Rank: #1861
Rank: #64
Solution

Hi Andrew,


You just have to:

  1. do a WITH OR WITHOUT join with voting;
  2. Group by {User}.[Id] and {User}.[Name] (or whatever are the attributes you need);
  3. Set a Count for voting.{UserId}
  4. Add Order on Count for Descending

For the message, you just need to add an expression showing the winner (the first record in the table since it is ordered by vote count) if the table is not empty:


See OML in attachment.


Kind regards,
João

TotalVotes.oml

Rank: #395

I guess he would also need to make the join with UserCriteria entity, since it have the mapping between user ID and Criteria ID and count to calculate total votes.

Rank: #1861

thanks


Rank: #395
Solution

Hi Andrew,

Please refer the attached OML for the solution. Kindly look into this and let me know, if you need any help.

Thanks & Kind Regards,

Sachin

TotalVotesSachin.oml

Rank: #1861

How to add these yellow umbrella elements

element.JPG

Rank: #395
Solution

Hi Andrew,

These 2 are the new attribute columns which has been added into the GetUsers aggregate to show the required results on the votingresult screen. 

Please feel free to ask more questions if you have more questions. :)

Thanks & Kind Regards,

Sachin

Rank: #1861