Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

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 (62126 B)
Tags:
Former Member
Former Member replied

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

1 View this answer in context
Not what you were looking for? View more on this topic or Ask a question