SSRS report - show value only if "pk" is present and if not then blank - ssrs-2012

I would like some help with a ssrs report.
When "PK" is present in column 2 i want to display the value in column 1 and if "PK" is no present in column 2 then to display nothing.
i have the below expression i just need the false to be blank.
=iif(Fields!ProdeCode.Value = "PK",Fields!LastMaterialCost.Value,False)

Have you tried to replace False with Nothing? or ""?
=iif(Fields!ProdeCode.Value = "PK",Fields!LastMaterialCost.Value,Nothing)

Related

Data Manipulation - Power Query

Relatively new to Power Query. How would one get "value" into the "False" position based on "TEST"?
Table
Assuming you want to test one column, and place a result into a new column
Add Column ... Custom column ...
formula
= if [YourTestColumnName] = "TEST" then "FALSE" else null

PowerApps: Filter a Lookup Field Based on a Previous Field

I have two lists w/ the following details:
List 1: JobType1; Column: Title
List 2: JobType2; Columns: Title, JobType1 (lookup of Title column of List 1)
On List 3 (Request), I am trying to use PowerApps and I have two fields that are lookups of the two lists:
JobType1 - lookup field that uses the Title column of List 1
JobType2 - lookup field that uses the Title column of List 2
I am trying to filter JobType2 field in the form to display all values on the Title column on List 2 that matches the value of the JobType1 field in the form w/ the JobType1 column on List 2.
I tried using this formula but it does not work. Please help me.
Filter(Choices(IntMktg.Job_x0020_Type_x0020_2), Value in Filter('JobType1', IntMktg.Job_x0020_Type_x0020_1 = DataCardValueClient.Text).Title)
Combo box control doesn't display the result. It seems a bug. I tried it out with the 3 lists and created a form on JobRequest. Here is my formula and it works if you use a dropdown. while waiting for Combo box to be fixed, you can use dropdown instead of Combo box.
Filter(Choices(JobRequest.JobType2), Id in Filter([#JobType2], JobType1.Value = DataCardValue2.Selected.Value).ID)

How can I hide an rdlc report Tablix based on the contents of cells in a column, in Sql Server Report Services?

I have the following table in a report:
I need to hide the table (or even better, add some message that this has happened) for when all of the value cells pictured have no value. So in the picture example, the table would not be hidden, but if the 5 values were missing, it would be.
The problem is there's no real way to reference cells, or even columns in SSRS as far as I can tell via Google. Have I missed something?
My solution to this type of thing is to check the row count of the underlying data set for the tablix. If it is not zero, then show the tablix. This is what the expression would look something like in the Hidden property for the tablix.
=IIf(CountRows("DataSet1") <> 0, False, True)
Add a label that says something like "No data to report" to the report that only shows when the dataset is empty. Expression here:
=IIf(CountRows("DataSet1") = 0, False, True)
This assumes that no records will be returned in the dataset when there are no values for all selected columns. This also assumes that the name of your dataset is DataSet1.
EDIT:
Another possible approach is to check all of the dataset values that fill the cells, if they are all empty, then hide the tablix. Something like this could be used for the Hidden property:
=IIf(Fields!field_name1.Value <> "" OR Fields!field_name2.Value <> "" (etc.), False, True)
One other approach is to check for values in the SQL for the dataset. If all of the values are empty return an extra column, maybe named hidden, that is false. True if values are present. Not the prettiest approach, and it may mean a significant change to your SQL, but it could work.
With this last one, instead of returning true or false, you could return a 1 or 0. Then, in the RDL for the Hidden property, sum that column and if it is = 0, hide the tablix.
=IIf(Sum(Fields!hidden.Value, "DataSet1") <> 0, False, True)

Display "No Data" message when table is empty in BIRT Report

I want to hide a table and to report that "No Data" message is present if the query returns no data.
In computed columns i have added the columns which counts the number of rows present(i.e.TableCheck).
and i have created label just below the table with the message "No Data". In script onCreate i have added the below code.
if( countOfRows == 0 ){
this.getStyle().fontStyle = "italic";
this.getStyle().fontSize = "large";
}else{
this.text = "";
}
countOfRows = 0 is initialize in script.
In table visibilty propery, checked the Hide Element and added the below code in expression.
if (row["TableCheck"] == null){
true
}
else{
false
}
Problem: When dataSet is empty "No Data" Message is displaying.But when data set is not empty, then error message is not hiding.
Please let me know how to fix this.
Thanks in Advance.
Do it this way:
First add visual elements to display it when data set doesn't return any row.
Then define global variable in Initialize script of report root.
For example
rowsReturned = 0;
On your table that you'll evaluate data set to see is there rows returned on Visibility tab set next:
On elements you want to display whene there is no returned data set this on Visibility tab
If you want to hide the table when no data returned, you can write this in its Visibility property:
row.__rownum < 0
and in Visibility property of your "No Data" message you use the opposite check:
row.__rownum >= 0
Note that both components must be bound to the data set you want to check. In the case of the message component you can achieve this putting it in a header or footer row.
Alternative solution without using global variables (though functionally not quite the same, because the layout will always contain a table):
Add a binding numRows for the COUNT aggregate with the expression 1 to the table.
Set as visibility expression on the table header row:
!row["numRows"]
Add a new footer row to the table; for this footer row set the visibility expression
row["numRows"]
Merge the cells in this footer row, then place a label "No data found" into the table cell.

RDL/RDLC Matrix Report Column Header Formatting

I am trying to format column headers in my Matrix report on an RDLC report. I have the columns specified as DateTime in my dataset and if I leave the column alone Ex:
=Fields!FinancialsTableMonthYear.Value
It displays fine Ex: 1/1/2009 | 2/1/2009 | 3/1/2009 Etc...
But if I try and put any formatting on the column header Ex:
=MonthName(Fields!FinancialsTableMonthYear.Value, true)
It will display Ex: #Error | #Error | #Error Etc...
I have also tried Ex:
=Year(Fields!FinancialsTableMonthYear.Value)
Any ideas?
You should use =MonthName(Month(Fields!FinancialsTableMonthYear.Value))
If you want to show the name of the month, you can use this format:
Format(Fields!FinancialsTableMonthYear.Value, "MMM")
Change the "MMM" to any format you want.

Resources