Jump to content
  • 0

Not getting the correct score


IamGroot

Question

Hello Everyone,

Basically, I have a DataPage that let the users evaluate themselves by choosing a statement that best describes how they performed the task. Each statement have different point values. These values will be received in the fields. One value in each field. The score will be the sum of those values.
As the formula I use now in my tabular DataPage, If a user is performing the task 5 times, and the scores are 30, 40, 50, 60, 70 - the displayed score will be 250.

How should the formula look like to display only the last score, in this case 70? Depending on the user who just logged-in.

This is the formula I currently use:

IsNull((SELECT (SUM(EvalA)+SUM(EvalB)+SUM(EvalC)+SUM(EvalD)) FROM TABLE_EVAL WHERE USERS = '[@authfield:User_ID]'),0)


Thank you in advance :D 

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Hello @IamGroot,

For you to be able to get the last score from your user's self evaluation, you can  just use this SQL formula in your calculated field instead:

(SELECT TOP 1 EVALA FROM TABLE_EVAL WHERE USERS = '[@authfield:User_ID]' ORDER BY Feedback_ID DESC) + 

(SELECT TOP 1 EVALB FROM TABLE_EVAL WHERE USERS = '[@authfield:User_ID]' ORDER BY Feedback_ID DESC) +

(SELECT TOP 1 EVALC FROM TABLE_EVAL WHERE USERS = '[@authfield:User_ID]' ORDER BY Feedback_ID DESC) +

(SELECT TOP 1 EVALD FROM TABLE_EVAL WHERE USERS = '[@authfield:User_ID]' ORDER BY Feedback_ID DESC)

In this formula, it will just get the last value of (EVALA, EVALB, EVALC, & EVALD) in the TABLE_EVAL depending on the user logged in your DataPage.

I hope this helps :) 

~WatashiwaJin~

Link to comment
Share on other sites

  • 0

You can also add a formula field in your table that will get the overall TOTAL of the user evaluation.

For Example (Formula field: TOTAL): 

[@field:EVALA] + [@field:EVALB] +  [@field:EVALC] + [@field:EVALD] 

Then you can just call that one field in your calculated field instead:

SELECT TOP 1 (TOTAL) FROM TABLE_EVAL WHERE USERS = '[@authfield:User_ID]' ORDER BY Feedback_ID DESC

I hope this process also helps you :) 

~WatashiwaJin~

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...