locked
Switch for Measures RRS feed

  • Question

  • Hi all

    I have a very simple reporr - one Dimension, one Measure, FromDate, ToDate - but I would like the users to be able to choose from three possible Measures instead of leaving them just the one. I created a Parameter called Measures with the appropriate labels and values. In the Measure textbox, I am trying to use the following expression:

     =Switch(
    Parameters!Measures.Value="NetAmount",Sum(Fields!Net_Amount.Value),
    Parameters!Measures.Value="ROCount",Sum(Fields!RO.Value),
    Parameters!Measures.Value="PaintedRO",Sum(Fields!Painted_RO),
    )

    This is not working. I suspect you can't use a switch statement in this way. Can anyone suggest an alternative?

    Thanks 

    Wednesday, June 22, 2011 2:50 AM

Answers

  • =IIF(Parameters!Measures.Value="NetAmount",Sum(Fields!Net_Amount.Value),
    		IIF(Parameters!Measures.Value="ROCount",Sum(Fields!RO.Value),
    			,Sum(Fields!Painted_RO)))
    


    Hi Richard,

    Use can use IFF Statement here.


    Rakesh M J

    Dont forget to mark it as Answered if found useful

    MCTS,MCITP,MCSS

    http://mycubeandreports.blogspot.com/

    Wednesday, June 22, 2011 3:33 AM

All replies

  • =IIF(Parameters!Measures.Value="NetAmount",Sum(Fields!Net_Amount.Value),
    		IIF(Parameters!Measures.Value="ROCount",Sum(Fields!RO.Value),
    			,Sum(Fields!Painted_RO)))
    


    Hi Richard,

    Use can use IFF Statement here.


    Rakesh M J

    Dont forget to mark it as Answered if found useful

    MCTS,MCITP,MCSS

    http://mycubeandreports.blogspot.com/

    Wednesday, June 22, 2011 3:33 AM
  • Hi Rakesh

    You know I tried that but couldn't get it right initially. Then after looking at yours I realized my mistake.

    Thanks!

    Wednesday, June 22, 2011 3:53 AM