Formula help

I have a select one field called {classification} there are four choices =
affected, minor, major, or destroyed Depending on which one they select I
want to calculate a value based of a percent based on that selection and
the amount the enter in another field.

Affected = .15
Minor = .20
Major = .50
Destroyed = 1

So if they if they entered 100,000 in the {value} field and picked
“Affected” from the {classification} field

The formula would be {value} * .15

But if they picked “Minor” from the {classification} field

The formula would be {value} * .20

Need some help…thanks!

Hi Andrew,
in the survey sheet you should put:

type name label calculation
integer value enter value
select_one classification class choose class
calculate result ${value}*${class}
note note the result is ${result}

in the choices sheet you should put:

list_name name label
classification 0.15 Affected
classification 0.20 Minor
classification 0.50 Major
classification 1 Destroyed

I hope this helps.

Cheers,
Andrea

··· On Friday, May 8, 2015 at 2:15:23 AM UTC, Andrew Faust wrote: > I have a select one field called {classification} there are > four choices = affected, minor, major, or destroyed Depending on which one they select I want to > calculate a value based of a percent based on that selection and the amount the > enter in another field. > > > Affected = .15 > > Minor = .20 > > Major = .50 > > Destroyed = 1 > > > So if they if they entered 100,000 in the {value} field and > picked “Affected” from the {classification} field > > > The formula would be {value} * .15 > > > But if they picked “Minor” from the {classification} field > > > The formula would be {value} * .20 > > > Need some help…thanks!

Thanks that helps. And works sort of. It does what I want but creates
another issue.

By using:
list_name name label
classification 0.15 Affected
classification 0.20 Minor
classification 0.50 Major
classification 1 Destroyed

Now I do not get the information of Affected, Minor, Major, Destroyed that
I also need. Is there a way to push that information along without asking
it two times. I need that also because I count out the number of each
classification type in a report that I make.

Thanks again for the help

Andy

··· On Friday, May 8, 2015 at 10:52:20 AM UTC-5, andream...@gmail.com wrote: > > Hi Andrew, > in the survey sheet you should put: > > type name > label calculation > integer value > enter value > select_one classification class choose > class > calculate result > ${value}*${class} > note note > the result is ${result} > > in the choices sheet you should put: > > list_name name label > classification 0.15 Affected > classification 0.20 Minor > classification 0.50 Major > classification 1 Destroyed > > I hope this helps. > > Cheers, > Andrea > > On Friday, May 8, 2015 at 2:15:23 AM UTC, Andrew Faust wrote: > > I have a select one field called {classification} there are > > four choices = affected, minor, major, or destroyed Depending on which > one they select I want to > > calculate a value based of a percent based on that selection and the > amount the > > enter in another field. > > > > > > Affected = .15 > > > > Minor = .20 > > > > Major = .50 > > > > Destroyed = 1 > > > > > > So if they if they entered 100,000 in the {value} field and > > picked “Affected” from the {classification} field > > > > > > The formula would be {value} * .15 > > > > > > But if they picked “Minor” from the {classification} field > > > > > > The formula would be {value} * .20 > > > > > > Need some help…thanks! >

Hi Andrew,

If I understand well, you want to count how many forms contain the answers
"Affected", "Minor", etc. The information you are looking for is already
there and does not require additional programming. Simply count the number
of occurrences of "class"= 0.15, 0.20, 0.50, 1.
E.g. the forms in which Destroyed was chosen are the ones that have "1" in
the column (variable) "class". To know the number of forms with answer
"Minor", just count the times "class" is equal to "0.20". And so on.

With some (simple) additional computation is possible to push along the
information in "words" instead of numeric values - but it does not add
much information.

Cheers,
Andrea

··· On Sat, May 9, 2015 at 4:04 AM, Andrew Faust wrote:

Thanks that helps. And works sort of. It does what I want but creates
another issue.

By using:
list_name name label
classification 0.15 Affected
classification 0.20 Minor
classification 0.50 Major
classification 1 Destroyed

Now I do not get the information of Affected, Minor, Major, Destroyed that
I also need. Is there a way to push that information along without asking
it two times. I need that also because I count out the number of each
classification type in a report that I make.

Thanks again for the help

Andy

On Friday, May 8, 2015 at 10:52:20 AM UTC-5, andream...@gmail.com wrote:

Hi Andrew,
in the survey sheet you should put:

type name
label calculation
integer value
enter value
select_one classification class choose
class
calculate result
${value}*${class}
note note
the result is ${result}

in the choices sheet you should put:

list_name name label
classification 0.15 Affected
classification 0.20 Minor
classification 0.50 Major
classification 1 Destroyed

I hope this helps.

Cheers,
Andrea

On Friday, May 8, 2015 at 2:15:23 AM UTC, Andrew Faust wrote:

I have a select one field called {classification} there are
four choices = affected, minor, major, or destroyed Depending on which
one they select I want to
calculate a value based of a percent based on that selection and the
amount the
enter in another field.

Affected = .15

Minor = .20

Major = .50

Destroyed = 1

So if they if they entered 100,000 in the {value} field and
picked “Affected” from the {classification} field

The formula would be {value} * .15

But if they picked “Minor” from the {classification} field

The formula would be {value} * .20

Need some help…thanks!

--
Andrea Martin

*M&E Consultant *

World Bank - Sierra Leone

ph: +232 (0) 762-321-50