How to make emulist options into numbers?

Hi,

I would like to create an app to calculate the risk.

For example, let me take just two questions.

column 1 - residence_type - urban and rural.
column 2 - literacy_level - literate and illiterate.

While entering data (collecting data) I would like to show the options on the app as two buttons. I used ‘emunlist’ feature to create that.

Now, I would like to get a score at the end.

Let’s say
residence_type: urban = 0, and rural = 1.
literacy_level: literate =0, and illiterate =1.

I would like to add the assigned numerical values of residence_type and literacy_level and show the score and add it as a column.

I am new to coding and AppSheet. I will be glad if I get help.

Thanks to all the beautiful people who are helping each other.

Like this?

(
  0
  + IFS(IN("urban", [enumlist]), 0)
  + IFS(IN("rural", [enumlist]), 1)
  + IFS(IN("literate", [enumlist]), 0)
  + IFS(IN("illiterate", [enumlist]), 1)
)
3 Likes

The logic looks perfect. Thank you. But where do I add this?

Where do you need it?

2 Likes

I would like the calculated score as a new variable in the same table.

For each row? Add a new column and put the expression in as the column’s App formula.

2 Likes

Thanks a ton, Steve.

1 Like