SSRS null parameter to return values - ssrs-2008

I have two reports bound to each other. On the first report when I choose a field I am lead to a second report showing only data from the row I selected in the first report. The second report is used for updating, therefore it takes in parameters. I have three text-boxes which allow a null value and a dropdown list.
First when I created the dropdown list and specified the values, and added a null value the report returned the row I selected in the first report with all the data. Now I tried to assign the values of the parameter to a database, but each time I get to this report it first asks to select a value from the dropdown and then it will display the data.
How can I add a Null value to the items retrieved from the DB so when null is selected as default then all values would be returned without any problems, and without any selection needed?

You would need to add a condition to your Dataset query to handle the NULL parameter.
For example:
WHERE #Parameter is NULL or ColumnValue = #Parameter

Working with NULL valued parameters, I usually use this syntax:
WHERE ColumnValue = COALESCE(#Parameter, ColumnValue)

Related

how to replace null values in dynamic table with 'mean' or 'unknown' as per the column data type in azure data factory?

I have data from two data sources i.e SQL and PostgreSQL. For every table want to replace the column having 'Null values' with MEAN if column type is integer and by 'Unknown' if column type is string.
I have tried using derived column but i am not sure how to pass on dynamic column values.
I created a pipeline with the 'LookUp' activity and 'ForEach' activity and calling a dataflow.
The migration is happening from SQL to Postgres so need to validate tables as well null values.
you have 2 cases here, the first one is replacing a null values in a string column with 'unknown' and the second case is replacing null values in an integer column with the mean of the values in the same column.
Main idea:
add a derived column , replace the null values in a string with unknown
fix the null values in an integer column,replace null with zeros so we will replace these zeros with the mean value when we calculate it by using a window activity.
Here is a quick demo that i built in ADF.
First, i created a dataset with 3 columns (name,height,address), height type is integer and address is a string like so:
ADF:
Derived Column activity:
modified address and height column as mentioned above.
Window activity:
in window activity, the idea is to replace the zeros with the mean value, to see the difference, i added a new column named it 'newHeight' just we can see the difference but you can override the original height column
in window settings -> window columns :
added a new column newHeight with the value :
case(height == 0 ,divide(sum(height),count(height)),toLong(height))
Output:
please read more about window transformation here:
https://learn.microsoft.com/en-us/azure/data-factory/data-flow-window

how to avoid cascading in ssas parameters in ssrs report and load default "all" when report loads?

i have a ssrs report which uses ssas data source and all of the parameter in report also come from ssas data source. the problem is parameters are acting as cascading parameters. i can not have values in parameter drop-down until i select parameter from previous drop-down.
i wanted to have default value "All" selected when report loads instead of waiting for selecting first parameter and then load subsequent?
i have removed #parameters from parameter data source and now here is how my MDX looks like:
WITH MEMBER
[Measures].[ParameterCaption] AS [Category].[Category ID].CURRENTMEMBER.MEMBER_CAPTION MEMBER
[Measures].[ParameterValue] AS [Category].[Category ID].CURRENTMEMBER.UNIQUENAME MEMBER
[Measures].[ParameterLevel] AS [Category].[Category ID].CURRENTMEMBER.LEVEL.ORDINAL
SELECT
{
[Measures].[ParameterCaption],
[Measures].[ParameterValue],
[Measures].[ParameterLevel]
} ON COLUMNS ,
[Category].[Category ID].ALLMEMBERS
ON ROWS FROM
( SELECT ( [OwningEntity].[Entity ID] )
ON COLUMNS FROM
( SELECT ( [Organization].[Organization] ) ON COLUMNS FROM [PerformanceScores]
))
Create Additional data source , point your first parameter with default value "from query" to that data source - This parameter need to be on the top of the list as in SSRS order of parameters is important.
- Let me know if you got any problems.
Thanks
Daniel
Create hidden parameter with IIF statement in default value.
in IIF put dummy date - this will not execute the report but will fill all the other parameters.
IIF(yourparameter.value="",dummydate.value,yourparameter.value)
Use this hidden parameter as your "Main" data range but default value will depend on visible parameter value in IIF statement when user can choose the range
This should work...

disable/disregard a second parameter based on the first parameter

I have 2 multi-value parameters in my report. When we generate the report using only one of them a problem arises. If I select a value for parameter 1 and keep parameter 2 unselected I get an error:
Please select a value for the parameter Param2
This happens even if I check "allow blank value" in the parameter's properties.
In addition: is there a way to make a set a parameter to be enabled/disabled based on a another parameter's value? For example:
if I create another parameter having values Param1, Param2;
if I select a value for Param1 the report will be generated based only on values selected in Param1, disabling or disregarding Param2
The short answer is no.
My workaround for this scenario is to fiddle with the Dataset driving the Available Values list for Param2. You need to set it up so that when the particular Param1 value is selected, the only row that will match will be a dummy row (e.g. 'N/A'). This might involve a UNION ALL to generate that dummy row.
I use the same dataset for Default Values so that the dummy row will be automatically selected when the Param1 value is selected.
You then need to cater to that dummy Param2 value in the other datasets that refer to Param2, e.g. SELECT ... WHERE ( #Param2 = 'N/A' OR Column2 = #Param2 ).

SSRS no data in report

I have a single tablix on the SSRS report which fetches data from a stored procedure.
I am trying to show a meesage to the User when no data is present say, "** There is no data for this report*". I can do this easily by specifying this message in the **NoRowsMessage property of the tablix. But I want to show the headers of the tablix along with this message.
If I don't set the NoRowsMessage property, I get the headers but no message, but if I do, I get the message but no headers.
I need some help with this.
Note: I am using SSRS 2008.
Edit:
I can also put up a textbox with the relevant text message below the tablix and set it visible only if the tablix contains no rows. But I am not able to figure out as to how do I find out from the Visibility expression of the textbox whether the tablix contains any rows or not.
A tablix object is related to the underlying dataset, so if there's no data, there's no table in the output.
Other than using the NowRowsMessage property, the only other way I can think of to enforce this would be to ensure your query returns an empty value placeholder when there are now rows returned. This way you would have, in essence, a single data row.
You could then try and add a conditional expression on the table (i.e. on the Visibility property of the details row) to prevent any rows containing your placeholder from showing up.
So in your query you could have:
IF (##ROWCOUNT= 0)
BEGIN
SELECT
'[IAMEMPTY]' as [Col1]
,'[IAMEMPTY]' as [Col2]
,'[IAMEMPTY]' as [Col3]
END
And then in the Visibility property of your table's detail row:
=Iif(Fields!Col1.Value = "[IAMEMPTY]",True,False)
EDIT: Alternatively, to check if the DataSet is empty in SSRS and show a rectangle containing your message/headers (as mentioned in TooSik's comment), you could set up a rectangle with this in the Visibility expression:
=Iif(Rownumber("Dataset_Name")=0, False,True)

SSRS report parameters

In my SSRS report there are 2 parameters called DataSourceIDList and ReporterIDlist.
DataSourceIDList : is a drop down list and this will populate based on SQL query.
ReporterIDlist : is a drop down list and this will populate reporters based on selected Datasourceid from DataSourceIDList and this is also a SQL query.
both parameters are optional fields but when i am running the report i am getting error called "Please select value for DataSourceID" but i set the property for that parameter as allow NULL values
and same problem for ReporterIDlist also.
Please suggest your suggestion....
Thanks in advance...
I think that SSRS will not allow you NULL value if parameter have datasource.
Trick that I do when I need all values that is: I change data source for parameters that is in list have
null, or ( 0) value, and option select ALL, and after that I set default value to null so users do not have to touch parameters before it call it
Something like this,
Select 1,null as ValueOfParam,'All values' as TextOfParam
union all
select 2,id,name from myDatasourceThatHaveParamValues
order by 1,name
to verify date, you can use this method too:
make two rectangle; insert table/matrix in first rectangle
in second rectangle insert msg like
"Selected Date is not valid, please select correct date"
or "Start Date should be less less than End Date"
put appropriate msg, and make condition in 1st rectangle where all tables/matrix is there
iif( Parameters!StartDate.Value < Parameters!EndDate.Value,false,true)
in second rectangle where Error msg is inserted write this:
iif( Parameters!StartDate.Value < Parameters!EndDate.Value,true,false)