SSRS: Go To Action Expression to Direct to Seperate Drillthrough Reports - reporting-services

Currently, I have a tablix that shows Number of Records by Group and if they were Completed on Time. Tried to show best my Tablix in the picture below:
I only have 5 different groups that show up in my Groups column.
Groups:
Group1
Group2
Group3
Group4
Group5. There are currently actions attached on each value in the Number of Records Column.
I'm trying to include an expression in the Action portion that will help me to direct the end user based on a particular Group. For example, if the user selects a value from Group1, Group2 or Group3...I would like them to be directed to my Drillthrough Report "Drillthrough01". If the user selects a value from Group4 or Group5...I would like them to be directed to my Drillthrough Report "Drillthrough02".
I tried to do an expression below (I know it's wrong, but it's along the same lines of what I'm trying to do)
=IIf(Fields!Group.Value = "Group1, Group2, Group3", "Drillthrough01" , "Drillthrough02")
Not sure if anyone could help with fixing my expression or if they know a better way. Please let me know if need more information on my end.

With Alan's help, I basically used the IFF statement above with some slight edits and incorporated my IFF with multiple conditions using OR and got it to work.

Related

IIF parameter with two condition on same row

I'm creating a new report where one of my flags as to do with the Taxes we have here in Quebec. In this report, I'm displaying invoices with a header, the details (items) and then the total with the taxes.
Now here in Quebec we have TPS and TVQ as taxes. Sometimes, when we sell outside of the Quebec area at one of our other branch, we wont have the TVQ.
The goal of my flag, is to turn the textbox red when TPS is there and TVQ isn't there. I also want to do the same thing if TVQ is there and TPS isn't.
I kinda feel like it should look a little like that
IIF ((Fields!TAXDLID.Value = "TPS") AND (Fields!TAXDLID.Value = "TVQ"), black, red)
but I can't wrap my head around.
Thanks for the help!
edit:
Here is something that works and doesn't need red flags
Here is something that also works and doesn't need red flags
Here is something that does not work and would need a flags since it doesn't have TVQ
It's also possible to have nothing in the section
It's not perfectly clear what your dataset looks like (from your dataset query) so I have made some assumptions as follows:
Each row in your dataset has a Column that is either 'TPS' or 'TVQ'
Your dataset only contains data for a single invoice per report.
Your main report dataset is called dsMain
Assuming 1 invoice per report
Assuming the above, as your column can only contain one of two values we can simple count how many unique values are in the dataset.
You can do something like this
=IIF(CountDistinct(Fields!TAXDLID.Value,"dsMain") >1, "Black", "Red")
More than one invoice per report
If you are producing more than one invoice per report then I would imagine you have a row group setup that groups by invoice number. If this row group is called grpInvoice then you need to swap out the dsMain scope expression for the name of your row gorup
e.g.
=IIF(CountDistinct(Fields!TAXDLID.Value,"grpInvoice") >1, "Black", "Red")
Note
The scope name MUST be the exact spelling of the row group name or dataset name, it is case sensitive AND is must be enclosed in quotes as per the example.
If this does not help, please provide a sample of the data that comes from your dataset query and your report design including grouping info where applicable.

Can I use WHERE clause in an SSRS expression?

I saw the post on WHERE clause in SSRS expression. I am also trying to do a where clause, but in a different way. I need to show ItemDesc when ItemId = 4. I set a parameter so that it will always equal 4 for this cell. Now I just need the matching description field. I cannot hard code it because the description may change one day. Is there a way to associate the two fields?
=IIF(Parameters!ItemID_4.Value = 4, Fields!ItemDesc.Value,"")
I am converting from Crystal Reports to SSRS. This first image is the output from CR. I only need to show that ItemDesc in that top left cell.
This next image is from SSRS. It is not limiting the descriptions. It seems to be doing what my expression is saying. ItemID = 4, so display all ItemDesc values but the two fields are not associated right now. I need it to only show the matching value.
Thank you for your help.
I cannot hard code it because the description may change one day.
You are hard coding the parameter anyway by trying to do it that way. I don't think you need a parameter to achieve the result unless you are restricted from adjusting the dataset query.
If you are using an embedded SQL query for your dataset, I would just put a filter in WHERE clause: WHERE ItemID = 4
Another way if you can't adjust the query is to go to Report Data view > Right click on the dataset for your table, "Dataset Properties" > go to the "Filters" tab and add a filter with these settings: Expression = ItemID, Operator = "=", Value = "4" (or "#ItemID" if you want to keep your parameter).

SSRS report pass multiple VALUES to drill through report parameter

I created a report with 5 fields in a hierarchical order:
Order Date
Time of Day (AM/PM)
Parent Name (aka customer)
Product Line
BIC Part Number (aka Item)
Each field expands down to the next level, so order date expands to time of day, etc.
I want to create a drill through report so that the user can click on each level of the hierarchy and see the detail.
This works fine at the lowest level - Item - because only 1 values from each field has to be passed to the drill through report parameter. However, when I try, for example, to drill through based on Product Line, there will usually be 3 or 4 Items within this product line. In the Go To action, I have the drill through parameter "bic_part" set to the main report FIELD value "BIC Part Number".
I have the tablix on the drill through report set where "BIC Part Number" IN [#bic_part].
I just want to be clear, I am passing a set of report field values to the drill through report parameter, not parameter to parameter.
I have tried using expressions with =Split(Join(field value),","),",") and all variations on that. I can't seem to get the child report filters to accept multiple values from the BIC Part Number field from the parent report.
I also tried omitting the BIC Part Number value in the go to report section, but it would not let me.
All of the parameters in the child report are set to accept multiple values. My data source for both reports is the same stored proc, so I can add a query filter. I would appreciate any help.
I think each sub report link needs to be slightly different.
In the subreport, each parameter needs to accept null and your query needs to look for
(FieldName = #FieldNameParameter or #FieldNameParameter is null)
This will allow you to pass the lowest possible solid value, then null for all child values.
If we're looking at the Parent_Number level, on that subreport link you would pass Fields!Parent_Number.Value and then Nothing for each of the lower parameters (Product_Line, BIC_Part_Number).
This will allow you to filter on the lower common denominator in your sub report - Part_Number for this link, Product_Line for the next one down, etc.
I've used this logic in reports before, so it does work. Let me know if my explanation needs clarification - it's Friday afternoon..

Sum Values from Dataset based on condition: Report Builder

I have a report where users can select items from various location. And I have 3 datasets performing calculations where the third dataset takes the sum where item number is 4942200 and then calculates the values (as shown below):
=SUM(IIf(Fields!masterno.Value= "4942200",Fields!Owned.Value,0))+SUM(IIf(Fields!masterno.Value= "4942200",Fields!Subbed.Value,0))
This is returning error for some reason. The subbed column is toggled based on parameter (visibility). But before I add the toggle functionality, I want to make sure this is working. Can anyone help. I have also tried:
=SUM(IIf(Fields!masterno.Value= "4942200",Fields!Owned.Value+Fields!Subbed.Value,0))
This seems to fail as well. Help would be greatly appreciated.
I would wrap a CDec around Owned, 0 and Subbed, e.g.
=SUM(IIf(Fields!masterno.Value= "4942200",CDec ( Fields!Owned.Value) ,CDec (0 ) ))+SUM(IIf(Fields!masterno.Value= "4942200",CDec (Fields!Subbed.Value ) ,CDec ( 0 )))
If Owned and Subbed are already Decimals, those CDec's may be redundant. On the other hand SSRS doesnt expose this info and they can change at the whim of the data source.

In SSRS is there a way to make a Row Group expand based on parameter value?

I've got a table with 5 columns, the first 3 of which allow the user to drill down through the levels of detail. Each of these columns (Region, Country & Office) has an associated Parameter so the user can select the geographic region for their report. Each parameter allows the selection of multiple values.
If the user selects 1 Region, 1 Country and 1 Office it's not exactly ideal for them to then have to expand each selection. Is there an expression I can enter somewhere to state that if only 1 value is entered in a parameter then that data set will automatically show as expanded?
This is in SSRS 2008 R2 if that makes any difference.
In the Group Properties for the detail group you can enter an expression for the initial visibility. Right now you probably have that set to "Hide." The expression needs to return a Boolean and could be something like:
=Parameters!Country.Count <> 1
This will have SSRS hide those rows if more (or less) than one value are selected in the parameter Country
But I have seen some unexpected results with this: test thoroughly. In my experience, BIDS handles these better than SSRS itself, so just when you think you've got it all working, it fails miserably once deployed. (Reason number 14 to have a test folder on production SSRS.)