Forum Discussion

Grande's avatar
Grande
Frequent Visitor
5 years ago
Solved

If statement not working

Any help appriciated.. getting ERROR message with below condtion   P1 = IF(VW_ORT[Partime_Num.?] = 2, DIVIDE (VW_ORT[Annual Salary (Local Currency)], IF(VW_ORT[Partime_Num.?] = 1,(VW_ORT[Annual Sa...
  • CNENFRNL's avatar
    5 years ago

    Grande , it looks like you are authoring a measure, aren't you? If so, you might try,

     

    P1 =
    VAR __pt = MAX ( VW_ORT[Partime_Num.?] )
    VAR __as = MAX ( VW_ORT[Annual Salary (Local Currency)] )
    RETURN
        IF ( __pt = 2, DIVIDE ( __as, IF ( __pt = 1, __as ) ) )