Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
How can I write this in Qlikview.Please help me.
IIf(RTL_TERMS.TRMN_DT Is Null AND DATEDIFF("YYYY",QRYALL_RTL_WRK_ENDPOP.HIR_DT,QRYALL_RTL_WRK_ENDPOP.AS_OF_DT)*12+DATEDIFF("M",QRYALL_RTL_WRK_ENDPOP.HIR_DT,QRYALL_RTL_WRK_ENDPOP.AS_OF_DT) BETWEEN 0 AND 6, "011401",
IIf(RTL_TERMS.TRMN_DT Is Not Null AND DATEDIFF("YYYY",QRYALL_RTL_WRK_ENDPOP.HIR_DT,RTL_TERMS.TRMN_DT)*12+DATEDIFF("M",QRYALL_RTL_WRK_ENDPOP.HIR_DT,RTL_TERMS.TRMN_DT) BETWEEN 0 AND 6, "011401", "None"))) as Tenure
Thanks in advance.
Hi.
Maybe like this:
If(not isnull(RTL_TERMS.TRMN_DT) and rangemax(12*(year(QRYALL_RTL_WRK_ENDPOP.HIR_DT)-year(RTL_TERMS.TRMN_DT)) + month(QRYALL_RTL_WRK_ENDPOP.HIR_DT)-month(RTL_TERMS.TRMN_DT),0)>=6, '022401', 'None') as Tenure
Or
If(not isnull(RTL_TERMS.TRMN_DT) and addmonths(QRYALL_RTL_WRK_ENDPOP.HIR_DT, -6) <= RTL_TERMS.TRMN_DT , '022401', 'None') as Tenure