Expand my Community achievements bar.

SOLVED

math functions on radio group values

Avatar

Former Community Member

I have a form with 8 radio groups. Each group has 6 options, each with a value between 0-6.

I need to preform the following after a selection has been made on each group.

[Sum of all statements selected / (# of sections with a statement selected x 5)] x 100

and I want the resulting number to appear in a text box at the bottom of the page.

Please, any help would be nice!

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Here is a sample of what I think you want .....the code is on the calculate of the Total field at the bottom.

paul

View solution in original post

3 Replies

Avatar

Correct answer by
Former Community Member

Here is a sample of what I think you want .....the code is on the calculate of the Total field at the bottom.

paul

Avatar

Former Community Member

Thank you, that was perfect !

Only thing was.. My groups had values from 0-5 not 1-6, but that was easy to change.

If all the sections are a Zero value.. How do I get the answer to show a Zero?

currently when its equal to zero.. it shows a blank answer in the box.

Avatar

Former Community Member

By default the numeric field will show a blank to represent a zero .....allthough if you asked for the rawvalue it woudl report zero. You can define how you want the 0 value to be shown. On teh field click on the Object palette and choose the Patterns button. This will start another dialog. Click the Show zero and then in the field below indicate how you want to display your zero. In my case I put a 0 but you coudl put empty or anything you want. See the screen shot below:

Image1.png

Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----