Choose field based on the extract_months(now())

Mward
New Member

Hi everyone. I am looking to build a table calculation that chooses a field (sum of fields in this case) based on extract_months(now()). When I use the first IF statement, the calculation performs just fine. However, I can’t seem to get past the second iteration. My code looks like this:

if(extract_months(now()) <= 3, “Field 1”, if(extract_months(now()) <= 6, “Field 2”, if(extract_months(now()) <= 6, “Field 3”, “Field 4”)

Any help would be greatly appreciated!

0 1 194
1 REPLY 1

Maddie
New Member

Hi Michael,

It seems like you are in a maze of brackets there! 😃

You are on the right track, you are just missing two brackets at the end:

if(extract_months(now()) <= 3, "Field 1", 
  if(extract_months(now()) <= 6, "Field 2", 
    if(extract_months(now()) <= 6, "Field 3", "Field 4")
    )
  ) 

Best,
Maddie | Redkite

Top Labels in this Space
Top Solution Authors