Forum Discussion

jmetf150's avatar
jmetf150
Helper I
2 years ago
Solved

Switch with dates and text values/format

I am trying to write a SWITCH function that looks at a TEXT column ( [RS] ), and depending on the text value "OT", then compares between two other DATE columns ( [RDD] & [RCD] )to derive another TEXT...
  • Greg_Deckler's avatar
    2 years ago

    jmetf150 I think you want: 

    Cond = 
    switch(TRUE(),
       'R'[RS]="OT", IF('R'[RDD]<='R'[RCD], "PD", "LLT")
    )
    
    
    or
    
    Cond = 
    switch('R'[RS],
       "OT", IF('R'[RDD]<='R'[RCD], "PD", "LLT")
    )