Hi guys, sorry for bothering you. I'm making ...

(Tomadato Auditores) #1

Hi guys, sorry for bothering you. I’m making an app for a census with almost 500 neighborhoods. Each one is supposed to have an unique code for identifying purposes. In order to save time for the people who is going to make the work on the street i’m trying to apply that code number using the substitute function on the “Id Barrio” row, but it only works with the first choice.

Leaving an example:

SUBSTITUTE([Barrio], “Nueva Córdoba”, “291”) SUBSTITUTE([Barrio], “Alta Córdoba”, “17”) SUBSTITUTE([Barrio], “Alberdi”, “12”) SUBSTITUTE([Barrio], “Alto Alberdi”, “19”)

For the first one it works fine, then it returns “Alta Cordoba”, “Alberdi” and so on.

How may I fix this? Thanks in advance!

(Aleksi Alkio) #2

May I ask why do you need to use substitute? Why don’t you read the value from a table directly?

(Praveen Seshadri (AppSheet)) #3

@Tomadato_Auditores, was that entire thing meant to be a single expression. If so, use something like this:

SWITCH ([Barrio],

“Nueva Cordoba”, 291,

“Alta Cordoba”, 17,

“Alberdi”, 12)