SSRS - Setting data value columns dyanmically based on user inputs
Hello All, Please! tell me how can I set data columns dyanmically in line chart, based on user inputs? Thanks! alot in advance! deepak
November 23rd, 2011 9:37pm

Hi Deepak, You can use a parameter and switch () for this purpose. Create a parameter "UserReq" assign it a default value and available values in the form of some text that you will identify with each data column of your dataset. In the Line chart, select any measure at first. Right-click the measure you created and write this expression. = Switch( Parameter!UserReq.value= "Calls", Fields!CallAttended.value, Parameter!UserReq.value= "Quantity", Fields!GoodsQuantity.value ) Add as many cases as required. Regards, Manoj *Happy to help http://experiencingmsbi.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
November 24th, 2011 12:32am

Hello Manoj, Thanks! for the reply, your solution is working fine when I need to show only one data value column in line chart, but when I need to show multiple data values in line chart its not showing up. Switch is selecting the first condition which is true, and neglecting rest, I want whichever(more then 2 also) condition got true after comparing with the user input, should be shown in the line chart. please! reply! Thanks!deepak
November 24th, 2011 1:39am

Deepak, I don't think there is any dynamic population of measures in any SSRS chart. You can try this workaround though: Assumption: I am assuming there are 3 measure fields: M1 ,M2 and M3 Create a parameter UserReq (multi-select) and assign it 3 available values - M1 ,M2 and M3. Create a line chart, add the category you want. Also add 3 measures in Values axis each corresponding to M1, M2 and M3 values. Now, right-click each of these measures and go to Visibility tab. Select - "Show or hide based on expression" radio button. Write this expression to each of the measures you created respectively: = IIF(INSTR(1, Join(Parameters!UserReq.Label, ",") , "M1")>0, false, true) = IIF(INSTR(1, Join(Parameters!UserReq.Label, ",") , "M2")>0, false, true) = IIF(INSTR(1, Join(Parameters!UserReq.Label, ",") , "M3")>0, false, true) Now, the line chart will show only according to user selection of the parameter. You can make use of user-friendly names for your parameter but then change accordingly to your expression. Please, let me know if it helps! Regards, Manoj *Happy to help http://experiencingmsbi.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
November 24th, 2011 6:12am

Hello Manoj, It's one of the way to do that, but in my case the M is not finite, it varies. You can think it as cases, which will keep adding in the system. So, I cant define any limit for it. Regardsdeepak
November 24th, 2011 6:32am

Yes, I can understand there can be any number of fields and manually creating cases is very tiring and tough to manage as well. But, right now i can tell you this only. If i will come across more on your req, will share it with you. Regards, Manoj *Happy to help http://experiencingmsbi.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
November 24th, 2011 6:48am

ok, I'll also share my workaround(if, any I'll get) with all. Thanks!deepak
November 24th, 2011 7:04am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics