7 Replies Latest reply: Mar 16, 2018 3:37 AM by Jon Erik Lindberg RSS

    Help with nested IFs

    Jon Erik Lindberg

      Hello,

      My nested IF statemement looks like this:

       

      if(type='STATISTIKK',Sum({$<År={$(=yearfrom)}>}[Folkemengde_31.12_stat]),

      if(type='TILBUD',Sum({$<År={$(=baseyear-1)}>}Folkemengde_3112),

      if(type='FRAMSKRIVNING',Sum({$<År={$(=baseyear-1)}>}Folkemengde_3112),

      if(type='TRENDFLYTTING',Sum({$<År={$(=baseyear-1)}>}Folkemengde_3112),

      '-'))))

       

      The strange thing i that the first line does not return any results. The other if lines work like a charm.

      But if I reduce the formula, like this:

      if(type='STATISTIKK',Sum({$<År={$(=yearfrom)}>}[Folkemengde_31.12_stat]),

      '-')


      it works perfectly.


      I cannot figure out why this happens. Any help would be welcome.