0

Optimize Formula

switch Medicion do
case 1:
    (select DOCUMENTOS where 'Ganado REAL' = 10)
case 2:
    (select DOCUMENTOS where 'Ganado REAL' = 50)
case 3:
    (select DOCUMENTOS where 'Ganado REAL' = 80)
case 4:
    (select DOCUMENTOS where 'Ganado REAL' = 90)
case 5:
    (select DOCUMENTOS where 'Ganado REAL' = 100)
case 6:
    (select DOCUMENTOS where 'Ganado REAL' = null)
case 7:
    (select DOCUMENTOS where 'Ganado REAL' < 'Ganado PLAN')
end

I like to optimize this formula, and the last case 7 don't work.

2 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 2 yrs ago
    • Reported - view

    The reason why case 7 doesn't work is the fact you don't have a option 7 in your choice field, change it to 'default:'  instead, this means if there are no selections ,so your choice field is empty, then the defauld value would be picked. The formula looks good and no need for optimization needed in my eyes since you only use the select function only once in any case.

    Steven

      • Rafael Sanchis
      • Rafael_Sanchis
      • 2 yrs ago
      • Reported - view

      RoSoft_Steven 😵 Thanks Steven