0

Formula Problem.

Hi I need That if Horas Ganadas Real is = 0 then Horas Actuales is = 0 too.

The Horas Actuales is a Formula 

let t := this;
sum((select 'Horas-Actuales')[Semana <= t.Semana].'Horas Actuales')

5 replies

null
    • Fred
    • 2 yrs ago
    • Reported - view

    One way is:

    let t := this;
    if 'Horas Ganada Real' = 0 then
    'Horas Actuales' := 0
    else
    sum((select 'Horas-Actuales')[Semana <= t.Semana].'Horas Actuales')
    end
    
    • Rafael Sanchis
    • Rafael_Sanchis
    • 2 yrs ago
    • Reported - view

    Hi Fred 

    I think the problem is 'Horas Actuales' is a Formula ?

    • Fred
    • 2 yrs ago
    • Reported - view

    Right, so you would change it to:

    let t := this;
    if 'Horas Ganada Real' = 0 then
    0
    else
    sum((select 'Horas-Actuales')[Semana <= t.Semana].'Horas Actuales')
    end
    
    • Rafael Sanchis
    • Rafael_Sanchis
    • 2 yrs ago
    • Reported - view

    👍👋 Excelent Fred thanks a lot

    How you can see programming 0 😔

    • Fred
    • 2 yrs ago
    • Reported - view

    Since we are working in a formula field then we just needed to say what happens when 'horas ganada real' equal 0. So we just needed to put 0 after the THEN.

    Kinda like:

    if field1 = 0 then 0 else 1 end

Content aside

  • Status Answered
  • 2 yrs agoLast active
  • 5Replies
  • 37Views
  • 2 Following