Skip to Content
avatar image
Former Member

And operator is not working in If statement WebI 4.0 SP6

Hello Gurus,

I'm using if statement to create a variable .

The formula is as below.

= If [EG_EQNAME]="HP_PVD_TiN-01(A-C01)" AND [EQ].[Eqid]="76401" Then [AC-MFT].[EQ_PRD] Else

  If [EG_EQNAME]="HP_PVD_TiN-02(A-C02)" AND [EQ].[Eqid]="76402" Then [AC-MFT].[EQ_PRD] Else

  If [EG_EQNAME]="HP_PVD_TiN-03(A-C03)" AND [EQ].[Eqid]="76403" Then [AC-MFT].[EQ_PRD] Else

  If [EG_EQNAME]="HP_PVD_TiN-04(A-C04)" AND [EQ].[Eqid]="76404" Then [AC-MFT].[EQ_PRD] Else [Mft]

Another way--------------- Or ----------

= If [EG_EQNAME]="HP_PVD_TiN-01(A-C01)" AND [EQ].[Eqid]="76401" Then [AC-MFT].[EQ_PRD]

ElseIf [EG_EQNAME]="HP_PVD_TiN-02(A-C02)" AND [EQ].[Eqid]="76402" Then [AC-MFT].[EQ_PRD]

ElseIf [EG_EQNAME]="HP_PVD_TiN-03(A-C03)" AND [EQ].[Eqid]="76403" Then [AC-MFT].[EQ_PRD]

ElseIf [EG_EQNAME]="HP_PVD_TiN-04(A-C04)" AND [EQ].[Eqid]="76404" Then [AC-MFT].[EQ_PRD] Else [Mft]

I'm getting error as shown in attached image.

Please help me to resolve this error.

Thanking You in advance.

Regard's,

Thiru

IF_Error.jpg (62.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Dec 23, 2014 at 03:03 PM

    I created a variable Var1 with below formula.

    Var1 =If [EG_EQNAME]="HP_PVD_TiN-01(A-C01)" Then [AC-MFT].[EQ_PRD] Else

      If [EG_EQNAME]="HP_PVD_TiN-02(A-C02)" Then [AC-MFT].[EQ_PRD] Else

      If [EG_EQNAME]="HP_PVD_TiN-03(A-C03)" Then [AC-MFT].[EQ_PRD] Else

      If [EG_EQNAME]="HP_PVD_TiN-04(A-C04)" Then [AC-MFT].[EQ_PRD] Else [Mft]

    Then used Var1 in another variable Var2 with below formula.

    Var2 =If [EQ].[Eqid] InList("76401";"76402"; "76403";"76404") Then Var1 Else [Mft]

    Finally I used Var2 in my report.

    It worked perfectly.

    Regards,

    Thiru

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 23, 2014 at 01:29 PM

    Hi Thirupathi ,

    Check EQID objects qualification .It seems like measure.If it measure then no need to use double quotes(" ")

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hello Steesh,

      Thank you for your suggestion, I have already tried the same but not working. I used your formula too but no luck.

      Reagrds,

      Thiru