April 20, 2012 at 12:38 pm
I have requirements where I need to convert business objects report in SSRS, I canโt able to work the below statement "if" statement in SSRS. Thanks for your help in advance.
Business Objects
=If [Position Type]="Held" Then "Margin Posted to PRINCIPAL" Else If [Position Type]="Posted" Then "Margin Posted to COUNTERPARTY" Else If [Receiving Party]= "Counterparty" And [Position Type] ="Deliver" Or [Receiving Party] ="Principal" And [Position Type] = "Return" Then "Margin Posted to PRINCIPAL" Else If [Receiving Party]= "Principal" And [Position Type] = "Deliver" Or [Receiving Party] = "Counterparty" And [Position Type] = "Return" Then "Margin Posted to COUNTERPARTY"
SSRS
=IIf(Fields!PositionType.Value="Held","Margin Posted to PRINCIPAL",IIf(Fields!PositionType.Value="Posted","Margin Posted to COUNTERPARTY",IIf(Fields!RECEIVINGPARTY.Value="Principal","Margin Posted to PRINCIPAL",IIf(Fields!RECEIVINGPARTY.Value="Counterparty","Margin Posted to COUNTERPARTY","Margin Posted to COUNTERPARTY"))))
April 20, 2012 at 2:42 pm
You might find using a SWITCH statement is easier. A switch is a boolean condition followed by what happens if it is true, then another boolean etc.
=SWITCH(Fields!PositionType.Value="Held","Margin Posted to PRINCIPAL",Fields!PositionType.Value="Posted","Margin Posted to COUNTERPARTY",Fields!RECEIVINGPARTY.Value="Principal","Margin Posted to PRINCIPAL",Fields!RECEIVINGPARTY.Value="Counterparty","Margin Posted to COUNTERPARTY",1=1,"Margin Posted to COUNTERPARTY")
The 1=1 is acting as an ELSE for when none of the previous conditions are met.
April 21, 2012 at 5:09 am
Refere below one
Thanks & Regards,
Veeren.
Ignore this if you feel i am Wrong. ๐
April 25, 2012 at 9:56 am
Thanks for everyone reply, when i am using the above "Switch" statement i am not getting an correct data. Can you guys please let me know how can i resolve this in SSRS?
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply