I am using a split_string delimiter to be able to choose from multiple values from the SSRS report. I am able to select Multi Values in the SSRS report but the SSRS displays #Error where the multi value should be.
Picture for reference
This is what my expression for the report looks like
The count and ismultivalue in the expression works just fine
For Example:
I am using isMultiValue in the expression and it works fine
but Label and value throws #Error
In your report expression you are referecing the Parameter rather than the value that is passed to your Dataset, so successfully using a string_split function in the Dataset is actually unrelated here.
This is because multi valued parameters are Objects and not simple scalar values. When you do a count on the Parameter you are counting the items in the Object, which is a valid operation.
However, the Parameter object can't show you a single Value or a Label as it doesn't know which Value or Label to show you, even if there is only one item in the Parameter object.
What you need to do instead, is use a zero based Index value to specify which item you want to display:
="Bkt: " & Parameters!BKT.Label(0)
or tell SSRS to display all the items within the Parameter object as a list:
="Bkt: " & join(Parameters!BKT.Label,", ")
I want to send emails from my google sheet. I want the emails to address recipients by their first name or the name they are known by. The following is an example of my data in column A.
I need a formula in column B that extracts the first name from column A but if they are known by a different name, the name in the brackets in column A, then I want that name extracted to column B instead. I have the following formula which works for names in brackets but I need help with the formula to extract the first name when there are no brackets.
=(SPLIT(REGEXEXTRACT(A2,"\((.*)\)"),","))
one-cell solution:
=ARRAYFORMULA(IFNA(IFNA(
REGEXEXTRACT(A2:A, "\((.*)\)"),
REGEXEXTRACT(A2:A, ", (.*)"))))
Try this. In B2, enter this formula:
=iferror(SPLIT(REGEXEXTRACT(A2,"\((.*)\)"),","), mid(A2, find(", ", A2)+2, len(A2)))
Explanation:
The first part is yours:
SPLIT(REGEXEXTRACT(A2,"((.*))"),",")
As you've seen, this returns an #ERROR if the "(" isn't found. So use iferror to wrap that. The second part is returned if there is an error:
=mid(A2, find(", ", A2)+2, len(A2))
The mid() function returns a substring from a string. The first argument is the string that you're looking in, found in A2. Then, The starting position of the substring is the location of ", " (offset by 2), and continues to the end of the string.
Try this. In B1, enter this formula:
={"Salutation";arrayformula(if(A2:A="","",iferror((SPLIT(REGEXEXTRACT(A2:A,"\((.*)\)"),",")),index(split(A2:A," "),,2))))}
Explanation:
The first part is yours: SPLIT(REGEXEXTRACT(A2,"((.*))"),",")
As you've seen, this returns an #ERROR if the "(" isn't found. So use iferror to wrap that. The second part is returned if there is an error: index(split(A2:A," "),,2)
The index() function returns the second column from the split(). The advantage to doing it this way is you will not have to drag formulas down.
I have a stored procedure which drops either 1 or 2 columns from the result set. In my SSRS report, I have all possible columns that may come from the result set as dataset fields. I am trying to use the IsMissing function to change the column visibility, but it is not working. How can I make this functionality work?
I tried using examples from
https://sqlserverbi.blog/tag/hide-columns/
and
https://www.allaboutmssql.com/2013/01/ssrs-ismissing-visibility-function.html
where I right click the column, select Column Visibility and add an expression to the Show or hide based on an expression line.
Here is how I have been trying to use the expressions:
When I want to hide 2 of the columns I use:
=Fields!LINE_30_A.IsMissing And Fields!LINE_30_B.IsMissing
and when I want to hide only one of them I use:
=Fields!LINE_30.IsMissing
I have also tried the expressions like this:
=IIF(Fields!LINE_30_A.IsMissing And Fields!LINE_30_B.IsMissing,True,False)
I ran my stored procedure in a way that has dropped 1 of the columns from the result set. In this case the expression Fields!LINE_30.IsMissing should have been evaluated and I should be seeing the columns for Fields!LINE_30_A and Fields!LINE_30_B. But I only see the column for Fields!LINE_30 (which shouldn't be showing at all) and the other 2 columns are hidden. I also receive these 2 warnings:
1) Warning [rsErrorReadingDataSetField] The dataset ‘DataSet1’ contains a definition for the Field ‘LINE_30’. The data extension returned an error during reading the field. There is no data for the field at position 11.
2) Warning [rsMissingFieldInDataSet] The dataset ‘DataSet1’ contains a definition for the Field ‘LINE_30’. This field is missing from the returned result set from the data source.
I have a multivalued parameter named as Graduation_Year. It is a optional parameter. So I have used the "Please Select" as the default with value 0. Therefore I have used below query to make it optional and filter values only when a real value is entered.
EH.Pwks_year_of_graduation IN (#GradYear) OR 0 IN (#GradYear)
But here user has to de- select "Please Select" get the correct result.
I tried to filter the Graduation_Year parameter using dataset parameter expressions. But it didn't work.
Please suggest a method to filter out the 1st item in the multivalued parameter list (it can be used with below expression).
=iif((Parameters!GradYear.Value(0)="0" And Parameters!GradYear.Count>1)
,**Filtered Parameter value list**
,Parameters!GradYear.Value)
All I want is to remove Parameters!GradYear.Value(0),
when Parameters!GradYear.Count>1
form the multivalue parameter before it is considered in the query.
Thanks
Mathee
You have started off the wrong foot and now you are trying to fix something you shouldn't have done anyway.
The provided value **Please Select** should be a prompt and not a specified value for your parameter.
If you go to the parameter properties there is a property called Prompt specify Please select there.
Now when you execute the report it will show the parameter as follow:
I have a data set with the following fields:
Serialnumber, Dateofpayment, Paymentamount, Sourcecode and Campaign.
My data has only two campaign types, BS12 and BS13.
I'm trying to plot a running total of the payment amount by Campaign. In the chart I have the following expression for the Y value:
=RunningValue(Fields!PAYMENTAMOUNT.Value, SUM, "Campaign")
However, I keep getting the error:
The Y expression for the chart 'Chart1' has a scope parameter that is not valid for RunningValue, RowNumber of Previous. The scope parameter must be set to a string constant that is equal to the name of a containing group within the Tablix 'Chart1'.
I've looked up multiple sources and I feel like I am doing the right thing, Campaign is clearly a field in my tablix and I have entered it as a string. Why is the error occurring? - Can someone help me?
It's complaining about the scope parameter: "Campaign". Rather than pass the column name to the function, you need to define a group (if there is not one already) on that column in your chart and pass the name of the group instead. An example here.