SSRS filter a dataset if parameter is "Yes"

hello i have a report  as below
with date Parameters this all works fine! 
date from                date too 
01/01/2011   21/02/2013 
name        amount      date 
test1 100
          01/01/2012
test2        200             01/02/2013 
but what i want is to have another parameter which says something like yes or no and a filter on the data set which responds to the parameter
so that if the parameter = "yes" then filter the data set so as "not" too include test1 as a company but if "NO" then include all records! 
Steve mason

Add new parameter in SSRS report and pass it down to query .
In the query add a filter like below
WHERE....
AND (name <> 'test1' OR @NewParameter = 'No')
or if you want to do this in SSRS dataset do like below
=IIF(Parameters!NewParameter.Value="Yes",Fields!Name.Value,0) for Expression
<> for operator
and
=IIF(Parameters!NewParameter.Value="Yes","test1",1) for Value
in dataset filter tab as per below
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • FUNCTIONS WITH PARAMETER QUERY_ONLY="YES" FAILS TO OPEN FROM HOME PAGE

    Create a function, for example use the seeded function RESPONSIBILITIES to create a view only function by giving the parameter QUERY_ONLY="YES". Assign that responsibility to a user and login as the user and it would fail

    Pl post the full error message and message code
    HTH
    Srini

  • Filtering SSRS dataset on parameter INT

    Hi.
    I have a simple report which has a Week parameter.
    Week is a multi select parameter populated from a dataset (values 1-52).
    I have now added a filter to the main dataset:
    Expression: [Week]
    Operator: In
    Value: Split(Fields!Week.Value, ",")
    I get an error as soon as I try running the report with this filter:
    An error has occurred during report processing. (rsProcessingAborted)
    The processing of FilterExpression for the dataset ‘ProjectTimesheetDataSet’ cannot be performed. Cannot compare data of types System.Int32 and System.String. Please check the data type returned by the FilterExpression. (rsComparisonTypeError)
    I have tried wrapping the the expression and Value with Cint, no joy.
    If I write out the value of Week to the page using the Join funtoin I get resutls i.e. 48,49,50
    Where am I going wrong??

    Hi CDG100,
    Based on my research, I think this issue is caused by the data type mismatch between Week field and parameter WeekNumber. If I understand correctly, the Week field is Integer data type in your dataset, while the parameter WeekNumber is Text (String) data
    type. In your scenario, even we change the field to Integer (from Text), it will also turn back to Text. Because the filter always change the data type of Expression to match the Value data type. That’s the reason why the error message that “Cannot compare
    data of types System.Int32 and System.String” appears.
    So in order to fix the issue, please try to use an Integer data type field as the parameter values by using Get values from a query. Then the Week field and parameter WeekNumber can be compared.
    If there are any misunderstanding, please elaborate the issue for further investigation.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Filter a Dataset

    Hi there,
    I'm writing a website which compares products.
    What I want to do is display all the items in a dataset (got
    that done with spry dataset in CS4, reading live from SQL), then
    have some dropdown menu's which update the data displayed.
    The products i'm displaying have lots of fields, one of these
    is price. I want the drop down to have price ranges, such as 0-20,
    21-50 etc etc.
    Are there any guides or tutorials that will help ?

    Add new parameter in SSRS report and pass it down to query .
    In the query add a filter like below
    WHERE....
    AND (name <> 'test1' OR @NewParameter = 'No')
    or if you want to do this in SSRS dataset do like below
    =IIF(Parameters!NewParameter.Value="Yes",Fields!Name.Value,0) for Expression
    <> for operator
    and
    =IIF(Parameters!NewParameter.Value="Yes","test1",1) for Value
    in dataset filter tab as per below
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • SSRS : Reporting Services - Multi-Value Parameter Issue

    Hi,
    This problem is been around the blogs and forums for while now but may be it's not answered to the fullest. I couldn't get any satisfactory or completed solution on the issue so far, any clues/help will be highly appreciated.
    My scenario is very simple :-
    I am using SQL Server 2005 and SSRS. I need to develop a report which has a parameter value called Customer Name. The users should be able to select multiple customers from the list and sometimes Select All also.  I tried the following :-
    Created two data sets : Second dataset is just to populate the Customer Name
    Created a Report Parameter and mapped with the query parameter where it says  "Where CName in (@Parameter1)"
    Nothing seems to be working although I tried to apply all the existing half-way solutions currently available in the forums. May be I am not getting to the right solution.
    Here is what's happening :-
    When used '?' like "where CName = ?" then it's working fine for the single value. {Multi value query cannot be used with ?}
    But for multiple values when used @Parameter1 like "where CName in (@Parameter1)" it's giving the following error
    Cannot add multi value query parameter '@Parameter1' for data set 'Dataset1' because it is not supported by the data extension.
    However if commented this line it's pulling all the values whether or not selected from the parameter list.
    This is the basic thing which I was not able to get the desired result, in addition I was looking to get the Customer Name parameter selected with a partial entry as we use LIKE. Example :- If the user enters 'St' in the text box the list should show all the names starting from those two letters
    Starter
    Steve
    Steven
    Stevenson etc.
    I am not sure whether I'll will be able to get to this extent or not but until the multi value parameter, I am desperate to get the solution. So any sort of help/advise is highly appreciated.
    Regards,

    Hi,
    This problem is been around the blogs and forums for while now but may be it's not answered to the fullest. I couldn't get any satisfactory or completed solution on the issue so far, any clues/help will be highly appreciated.
    My scenario is very simple :-
    I am using SQL Server 2005 and SSRS. I need to develop a report which has a parameter value called Customer Name. The users should be able to select multiple customers from the list and sometimes Select All also.  I tried the following :-
    Created two data sets : Second dataset is just to populate the Customer Name
    Created a Report Parameter and mapped with the query parameter where it says  "Where CName in (@Parameter1)"
    Nothing seems to be working although I tried to apply all the existing half-way solutions currently available in the forums. May be I am not getting to the right solution.
    Here is what's happening :-
    When used '?' like "where CName = ?" then it's working fine for the single value. {Multi value query cannot be used with ?}
    But for multiple values when used @Parameter1 like "where CName in (@Parameter1)" it's giving the following error
    Cannot add multi value query parameter '@Parameter1' for data set 'Dataset1' because it is not supported by the data extension.
    However if commented this line it's pulling all the values whether or not selected from the parameter list.
    This is the basic thing which I was not able to get the desired result, in addition I was looking to get the Customer Name parameter selected with a partial entry as we use LIKE. Example :- If the user enters 'St' in the text box the list should show all the names starting from those two letters
    Starter
    Steve
    Steven
    Stevenson etc.
    I am not sure whether I'll will be able to get to this extent or not but until the multi value parameter, I am desperate to get the solution. So any sort of help/advise is highly appreciated.
    Regards,
    you speak spanish

  • SSRS table report based on parameter

    Hi ,
    I have @EMP parameter in ssrs report, for every employee there are ticket numbers. For one one Employee there may be two or three tickets. When I select @EMP1 in parameter a table will be displayed and on top of table ticket number is coming.If there are
    2 tickets for the same employee , two tables( table1,Table2) should come and the ticket numbers come ticket1 on table1 and ticket2 on table2 should come ...means based on the parameter slection the ticket numbers are coming and as per the number
    of tickets the cout of tables are coming....please help me in this .......I am using SQl not MDX :)

    Hi,
    According to your description, every employee have different tickets. Now you want to set a parameter, when you select one value from parameter, tickets of employee will appears in different tables separately.
    In this scenario, we can’t create a textbox out of a list, which can make ticket numbers dynamically appear on top of table based on parameter selection. However, we can combined a matrix with a list. Then create two parameters to select different values
    to show different tickets for same employee in different tables separately. Please refer to steps below:
    1. Add DataSet1, fill in with Employee, Ticket and Number.
    2. Add Dataset2, use query like below:
           Select distinct Employee from tic
        Use query in Dataset3 like below:  
           Select distinct Ticket from tic
    3. Add parameter @Employee, open Report Parameter Properties. On General page, choose “Allow multiple values” box. On available Values page, choose Get values from a query, set Dataset as DataSet2, Value filed as Employee, Label filed as employee. Add
    parameter @Ticket in the same way.
    4. Create a table, right click [Employee], choose Add group->Row groups->Parent group. In Group by box, choose Employee. Choose Add group header and add group footer boxes.
    5. Delete original Employee column. Right click [Employee], choose Split cells. Delete second row and forth row.
    6. Create a matrix, fill in with Employee, Ticket and Number.
    7. Create a list, drop the matrix into list. Right click anywhere in list, choose Select->Tablix3 to select list. On Properties, set DataSetName  as DataSet1.
    8. On Row Groups, choose Add Group->Parent Group from drop-list of (Details1). On Tablix group, choose [Ticket] from drop-list of Group by box. Looks like below:
    9. Click Preview, select different value from drop-list of parameters. The results look like below:
    Reference: Lists (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

  • SSRS Chart group dataset by Year (series groups)/Month (category groups) force intervals to start at JAN?

    Hi all,
    trying to figure this out in REPORT BUILDER, but I guess I can go to VS if needed...
    I've got a data set that says "sales" and its basically order summarycontaining:
    id, dateplaced, and other stuff...
    I want to use this dataset to show trendline for annual qty of orders
    created line chart with "countDistinct(id)" as the series for X
    category groups = groupby "=Month(dateplaced)" and label "=MonthName(Month(dateplaced)"
    series groups = group by "=Year(dateplaced)" and label the same.
    I think this is working as intended, please correct if not.
    The PROBLEM I'm seeing is that since my dataset returns data starting around september so my "axis" starts in september... I really would prefer it starts at Jan and ends in December... I can't see any way to do this...
    The only things I could think of are;
    put fake data in dataset that returns "empty" values for jan in the first year of data...
    change the query completely to make sure tehre are "year" "month" groupings... somehow...
    but both of these approaches seem to be "hacky" and not very maintainable or clear...
    Help!

    Hi noJedi,
    According to your description, you want to you have the category group in your chart always start from January. Right?
    In Reporting Services, when we set category group, the records will sort by the sequence of data in database by default. However, we can apply expression in
    Sorting so that those records can sort by the month. We have tested your scenario in our local environment, here are steps and screenshots for your reference:
    1. Create a chart and put the corresponding expression into category and series group.
    2. Right click on category group. Go to Sorting tab. Put the expression below into sorting expression.
    3. Save and preview. The result looks like below:
    Reference:
    Sort Data in a Data Region (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • How can ew add filter in Dataset of MDX Query

    Hi,
    I am working on TFS 2010 Report with Report Builder 3.0
    I need to fetch data on basis of Start Task Date(means when user start their task).
    So i have added a new field in a TFS Work Item Template with name StartTaskDate.
    Now i need to fetch the report FromTaskDate to TOTaskDate(Date Range Filter).
    so how can we do this with filter option?
    Can any body help me on this.
    Thanks

    Hi rohitnegi09,
    If you want @FromTaskDate and @TOTaskDate parameters are Date/Time data types, please refer to my last reply in the following thread:
    http://social.technet.microsoft.com/Forums/en-US/db75abb9-2250-463a-8ef3-70426f617329/mdx-report-on-date-range?forum=sqlreportingservices
    If you want @FromTaskDate and @TOTaskDate parameters are Text data types, we can directly type the following MDX query in the dataset:
    select
    {[Measures].[Internet Sales Amount]
    } on columns,
    {[Date].[Date].members} on rows
    from(
    select
    STRTOMEMBER("[Date].[Date].&["+@FromTaskDate+"]"):STRTOMEMBER("[Date].[Date].&["+@ToTaskDate+"]")
    ) on columns
    from [Adventure Works]
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Don't include last page of the SSRS report based on the parameter.

    I created the report, which has 4 pages.
    Each page contains bunch of tables and charts, which display data in scope of dataset, created for each page and reflecting certain subject.
    Each page also has Header and Footer.
    My users requested, the report has possibility to include or not include data on Page #4.
    Other words, report should display 3 or 4 pages based on the entered parameter.
    1. I created parameter named  “Include #### metrics”, which contains options: Y, N
     2. For each object on the page 4 I added dependency on the selected 
    parameter in  the visibility option.
    Now if user select parameter Not include Page #4, report displays 3 pages as expected and page #4 is empty, but with Header and Footer.
    The problem: Their
    preference is to not to show page 4 at all if someone chooses to not to include
    #### metrics.
    My question is how to force the report to display just 3 selected pages.

    Hi MK0526,
    Per my understanding that you have add page break to make the report to display on three diferent pages and you want to show and hide the fourth page based on the parameter selected, now the issue is although the content on the fourth page have been hidden
    but the page header and page footer still display, right?
    I have tested on my local envoronment and can reproduce the issue, the issue can be caused by the page break you have set, you may have check the "Add a page break after", please find the details information below to reset the page break:
    Please create four rectangles and add all the content from each pages to include in each rectangle
    Please  check the "Add a page break before" for rectangle2, rectangle3,rectangle4  in the rectangle properties and not add any page break in the  first rectangle (Rectangle1)
    Add expression below to show/hide the rectangle4:
    =iif(Parameters!IncludePage4.Value="No",true,false)
    Now you will not see the page header and footer in the fourth page when you select "No" in the parameter.
    If you still have any problem, please feel free to ask.
    Regards
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • Lookup or Filter multiple datasets in an Expression?

    Hi 
    I am new to Visual Studio and am trying to find my feet.
    I have a totals form which I can use an Expression to select all the data from multiple datasets fine, but I am wanting to filter the results to just show a single user at a time on my form. (Dataset shows Users and Grand Totals)
    Is it possible to use an Expression to say (Select ["Grand Totals" from Dataset1] where ["User" from Dataset1] = "Julie Smith") ?
    Thank you 
    Tracey

    Hello Tracey,
    Your issue is out of support range of VS General Question forum which mainly discusses the usage issue of Visual Studio IDE such as
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    I am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum.
    In addition, If you are working with Windows Forms app, you can consult on Windows Forms Forum:http://social.msdn.microsoft.com/Forums/windows/en-US/home?category=windowsforms
    If you are working with WPF app, you can choose WPF forum:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?forum=wpf
    If you are working with ASP.NET Web Application, I suggest that you can consult your issue on ASP.NET forum:
    http://forums.asp.net/
     for better solution and support.
    Visual Studio Language Forums:
    http://social.msdn.microsoft.com/Forums/vstudio/en-US/home?category=vslanguages
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Dataset as Parameter

    Hello!
    I would just like to ask if there's a way to make a dataset an oracle stored procedure parameter without looping through all the rows in the dataset?
    Thanks guys!

    the OleDB variable datasetYou might be better off in the ODP.NET forum.
    Cheers, APC

  • Filter out datasets with empty field

    Hi Experts,
    I want to filter a Table: Filter out all datasets where the FieldXY is empty. I tried with the filteroperator with expressions like '... is equal to NOT NULL' or '... is equal to NOT ''', but without result! Can some one give me the right expression?
    Kind regards, Bernd

    Hi Bernd,
    This was a bug in SP04
    I tried the
    =!ISNULL(@FieldXY)
    on SP05 and it worked.
    Sorry for the confusion.
    Best Regards,
    Udi

  • Film 'damage' filter in PremPro? Artificial grain, yes I see. But I need damage.

    I have used the artificial grain filter from time to time and it can wrk when applied properly, however, I am in need of a film damage filter. I'd like to add scratches, dirt, etc. is there a filter in premiere pro for that or one I can use in After Effects that I do not have to buy?
    I also have video of film damage, but cannot figure out how to get it mixed wth my footage. I have read about using something called X-Ray but have no clue what that is.
    Any help greatly appreciated.

    In general we do it by overlaying stock footage (there's tons of it on the usual agency websites, for a price). If your 'damage' clip doesn't already have an alpha channel, change the blend mode in the clip's Opacity effect (multiply, overlay, etc), then play with the opacity slider until you get what you want.
    A few people I know shooting on DSLR will use this idea to put back the "film look" - running filmscan on a strip of blank developed 35mm cine then looping it over their digital footage to put back the extremely-slight artifacts that you get from shooting on film. There are plugins for the same thing, but the DIY approach is cheaper if you can get hold of the stock.

  • How to use Oracle refcursor dataset output parameter from SP

    Can I request for help on how to use Oracle Output parameter from a stored procedure as a source. I need the output tobe stored in a flat file
    Thanks
    Abhijit
    Message was edited by:
    Abhijit77

    yes I would like to use it for ODI.. I would like the ouput of the refcursor to be fed to a text file using ODI. How to handle the records returned by the refcursor and map with txt file.

  • When I filter the dataset, though column name exists I got an error Cannot find column

    In the following lines of the code
    foreach (DataRow row in meterDs.Tables[0].Rows)
                    meterChannels = string.Format("{0} = {1}", Global.MeterIdColumnName, row[Global.MeterIdColumnName].ToString());
                    DataRow[] channelRows = ChannelsDs.Tables[0].Select(meterChannels);
    In the following line
     DataRow[] channelRows = ChannelsDs.Tables[0].Select(meterChannels);
    I got an error Cannot find column [Mtr_T1]
    In the debug mode run time values are:
    ? row[Global.MeterIdColumnName].ToString()
    "Mtr_T1"
    ? meterChannels
    "MeterId = Mtr_T1"
    ? Global.MeterIdColumnName
    "MeterId"
    Any clue?
    Thanks

    Hello, 
    The line 
    DataRow[] channelRows = ChannelsDs.Tables[0].Select(meterChannels);
    is trying to filter the data table where the Column value of MeterID equals the values in Column MTR_T1, if you do not have the MTR_T1 column in the ChannelDS.Tables[0] you will get the error.
    Regards, Dinesh

Maybe you are looking for

  • How do I back-up my iTunes library?

    I really don't know, but I'd like to. iTunes suggests it since I buy songs and stuff and well yea I have over 1,500 songs and I don't want to loose them. Can anyone tell me how? Thanks. Sony Vaio   Windows XP Pro   60GB iPod

  • Time Machine will no longer auto shutoff HDD

    I am running OS X 10.9.2 and I have a Seagate 1TB External HDD. Before Maverick my Time Machine would back up to my Seagate and then turn the HDD off automatically and then turn back on when it would do its next backup. Now my Seagate stays running 2

  • Changing type of process during runtime

    hi to all/Mike/Antony is there anyway to change a sync process to async during runtime? thnx in advance KAM

  • Why can't I see the Multicam Playback option in the TIMELINE RT pop-up menu

    Im trying to be able to do realtime editing in Multicam. Ive Created my Multiclip I've selected OPEN in the Sync menu. They'll plaback in the Viewer/Canvas in sync, but not with timeline In my TIMELINE, theres NO pop-up option for Multicam Playback i

  • Why buffer Hit greater than 100% in AWR

    hi, could anyone help explain why the buffer Hit is 376.58%, greater than 100% in my AWR. oracle version is 10.2.0.3.0. thanks! Instance Efficiency Percentages (Target 100%) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~             Buffer Nowait %: