SQL Reporting Services Boolean Parameter (True/False/All(?)) - boolean

I have a SSRS report that works with boolean parameter. I would like to add a third option to show all the records on the report. Both true and false. The concept is that the dropdown will include three options (All,True,False).
Is there a way to acheive that?
Thanks,
-Y

Set the dataset filter to something like this:
I have 3 available values for #parmTRUEFALSE
False = False
True = True
All Records = (Null)
=IIF(IsNothing(Parameters!parmTRUEFALSE.Value), ObjectFieldName.Value, Parameters!parmTRUEFALSE.Value)
If the user selects All Records... the filter uses ObjectFieldName.Value and returns all records because #parmTRUEFALSE = (Null) / IsNothing

Select Allow multiple values:
Then add the desired values:
Then add a new filter and convert the field value to String:
Then select the IN operator:

Related

MS-ACCESS How to loop all current form's query records to check if some field's value are equal to some textboxes value

I have a splitform linked to a query with some fields, this form has some textboxes but my focus is on 3 specific textboxes and query fields: type, date and id.
When i filter the datasheet view for some reasons, i want to check throught a buttonclick event if all the query records already filtered have the same field's values like the main form's textboxes values of my interesting.
For instance:
in the main form i have:
name: package
quantity: 10
type: normal
date: 01/01/2020
id:1
in the datasheet filtered by the 3 values of my interesting, i have 14 records that have the same values:
type: normal
date: 01/01/2020
id:1
How can i buttonclick's check if all the relative filtered query fields.value (type, date and id) of the 14 records are equal to the form's txtType.value(normal) and txtDate.value(01/01/2020) and txtid.value(1)?
thanks in advance.
found a solution..
i made a public function which compares all current query form's records with the relative txtboxes values thanks to the Form.RecordsetClone property:
Public Function CheckFilteredRecords(frmName As String) As Boolean
Dim rs As Recordset
Set rs = Forms(frmName).RecordsetClone
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst 'Unnecessary in this case, but still a good habit
Do Until rs.EOF = True
If Forms(frmName).txtID.Value = rs!ID.Value _
And Forms(frmName).txtType.Value = rs!Type.Value _
And Forms(frmName).txtDate = rs!Date.Value Then
CheckFilteredRecords = True
Else
CheckFilteredRecords = False
End If
'Move to the next record. Don't ever forget to do this.
rs.MoveNext
Loop
End If
rs.Close 'Close the recordset
Set rs = Nothing 'Clean up
End Function
You can call this function everywhere like this CheckFilteredRecords(Me.Name) and if all records match their relative txtbox.value, the function returns the True value.

How to set value in selected columns?

I use this code for select columns
select cities.name,cities.geom,cities.area
from cities,delivery
where ST_Intersects(delivery.geom,cities.geom)
It return this result
How i can set value "true" for "area" column?
I am not familiar with the language - tell me how to set the values? Biggest thx!
update cities set area = 'true'
from delivery
where ST_Intersects(delivery.geom,cities.geom);

How to create a drop down or multiple select filter in dashboard that will filter all worksheets?

I have null and non-null values in my dataset. I would like to create a drop down which will consist of -Display All, Null or Non-Null values. This should filter the dataset so that all worksheets in the dashboard are filtered out based on it. How shall I proceed?
A parameter will help you accomplish this.
Create... > Parameter > String > List > ["All", "Non-Null", "Null"]
From there, create a calculated field which references the parameter.
If [Parameter] = "Non-Null" Then
(If IsNull([Nullable Field]) = False Then 'Show' Else 'Hide' End)
ElseIf [Parameter] = "Null" Then
(If IsNull([Nullable Field]) = True Then 'Show' Else 'Hide' End)
Else 'Show'
End
Finally, place the newly created calculated field on filter and select only 'Show.' To filter all worksheets, right click on the filter and select Apply to worksheets > All using related datasource or specific sheets of your choosing.

Filtering one of the columns in an MDX query

I am comparatively new to MDX. I am working witht he following query :-
WITH
SET [Organisation Default Member]
AS
STRTOMEMBER(iif(isempty(LadbrokesSAS.GetDimensionSecurityUserDefaultOrgMember(USERNAME)),"[Organisation].[Organisation Hierarchy].[ALL]",LadbrokesSAS.GetDimensionSecurityUserDefaultOrgMember(USERNAME)),CONSTRAINED)
MEMBER [Measures].[ParameterCaption] AS '[Organisation].[Organisation Hierarchy].CURRENTMEMBER.MEMBER_CAPTION'
MEMBER [Measures].[ParameterValue] AS '[Organisation].[Organisation Hierarchy].CURRENTMEMBER.UNIQUENAME'
MEMBER [Measures].[ParameterLevel] AS '[Organisation].[Organisation Hierarchy].CURRENTMEMBER.LEVEL.ORDINAL'
MEMBER [Measures].[ParameterCaptionIndented] AS Space([Organisation].[Organisation Hierarchy].CURRENTMEMBER.LEVEL.ORDINAL) + [Organisation].[Organisation Hierarchy].CURRENTMEMBER.MEMBER_CAPTION
SET [Organisation]
AS Descendants([Organisation Default Member] ,[Organisation].[Organisation Hierarchy]. [Key Organisation],SELF_AND_BEFORE)
SELECT
{
[Measures].[ParameterValue]
,[Measures].[ParameterCaptionIndented]
} ON COLUMNS ,
{Organisation}
ON ROWS
FROM [ShopTradingCube]
The above query returns results like below:-
Now I want to filter the ParameterValue such that if it contains a value containing '[Organisation].[Organisation Hierarchy].[Supervisor - HO Manager]' it should not include that in the results. eg. [Organisation].[Organisation Hierarchy].[Supervisor - HO Manager].&[L7_Z_250_Closed]
I tried approaches using a where condition or by using an Except function. However, I always got some error no matter what all I tried. Can someone please let me know what should be my syntax and what is the most efficient way to achieve this?
Modify your set to the following:
SET [Organisation]
AS Descendants([Organisation Default Member] ,[Organisation].[Organisation Hierarchy]. [Key Organisation],SELF_AND_BEFORE)
-
Descendants([Organisation].[Organisation Hierarchy].[Supervisor - HO Manager])
This works like except.

How to filter rows with null values in any of its columns in SSRS

I want to filter out the output without rows containing null values or blank columns. I am using SQL Server 2012 there is no option named 'Blank' as in SS2005 where I can filter the rows. I also tried following expression but it gives me error or not showing correct output
=IsNothing(Fields!ABC.Value)!= True
=Fields!ABC.Value = ''
Please suggest the solution.
Pull up the tablix or group properties
Switch to "Filters"
Add a new filter
Set the expression to:
=IsNothing(Fields!YourFieldHere.Value)
Set the type to "Boolean" (see screenshot below) otherwise you'll get a "cannot compare data of types boolean and string" error.
Set the value to false
This works for filtering both rows and groups.
We should use the isNothing method in the Expression, change the Text to Boolean
and then Value will be "True"
for example:
Expression
=IsNothing(Fields!TestA.Value)<>True
(Expression type should be Boolean)
Operator
=
Value
=True
Edit the SQL query, so that it will not return NULL values in the column to group on, but let it return a dummy value; for example: ISNULL(columnA, 'dummy')
In the column group definition add a filter: ColumnA <> 'dummy'.