Problem with Sum IIf Expression

  • Hi guys!

    I hope someone can help me with this expression,

    The expression:

    =Sum(IIf(Fields!Name.Value="Cash",Fields!RiskValue.Value,0),"DS_AM_GetRisk_AssetType")/ Sum(IIf(Fields!Name.Value="Cash",Fields!GlobalMarketValue.Value,0),"DS_AM_GetRisk_AssetType")

    The table looks like this:

    |Name|---|GlobalMarketValue|---|RiskValue|

    1.|Fund|---|1501513|----------------|189613|

    2.|Struct|---|1511513|---------------|119613|

    3.|Stock|---|1591513|----------------|989613|

    The table also contains "Cash", but this is based on one persons specific account.

    The problem im having is that i need to get the expression to show blank if, lets say Cash is empty(null). If i run the expression now i get a "NaN"-value for cash.

    hope that someone can help me and do not hesitate to ask me if something is unclear.

    best regards,

    Andreas

  • I managed to solve the problem.

    I changed one of the false statements to 1 instead of 0, the Nan-value will disappear.

    Ex:

    =Sum(IIf(Fields!Name.Value="Stock",Fields!RiskValue.Value,0),"DS_AM_GetRisk_AssetType")/ Sum(IIf(Fields!Name.Value="Stock",Fields!GlobalMarketValue.Value,1),"DS_AM_GetRisk_AssetType")

    hope this can be helpful for someone else!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply