SSIS Derived Column Missing Downstream - sql

I've created a derived column that translates a 1 to an 'M' and a 2 to 'F'. i.e. a gender indicator. The derived column feeds into a Fuzzy Lookup transformation and then to a conditional split. The problem is the derived field does not show up in any of the downstream components. In the Fuzzy Lookup transform the "Pass Through" checkbox is checked for the derived column, but in the following Conditional Split transform the column does not show up at all. Funny thing is that the _Similarity_Gender_Derived does show up in the column list for the conditional split.
Hopefully someone else has seen this type of behavior.
Thanks - Mr. Do

Right click on the Fuzzy Lookup task and select Show Advanced Editor.
Go to the "Input and Output Properties" tab.
Expand the "Output" item, and then the "Output Columns" item.
Is your derived column listed there?
If it is, it should also show up on the available input columns of the Conditional Split task. If not ...
Right click on the Derived Column task and select Show Advanced Editor.
Go to the "Input and Output Properties" tab.
Expand the "Derived Column Output" item, and then the "Output Columns" item, and select your derived gender column.
Note its LineageID attribute.
Repeat the earlier steps to get the Fuzzy Lookup's Output Columns.
Hit the "Add Column" button. Name the column the same name as your derived column, and in the "SourceInputColumnLineageID" attribute, enter the LineageID you noted earlier.
Alternate answer: is your derived column creating an all new column, or simply replacing your existing "1/2" column? In the Derived Column Editor, check your "Derived Column" .. umm .. column. If you are just replacing your existing column with the new value (instead of adding a new column) you may just be looking in the wrong place.

Thanks for the response. Turns out that issue had to do with some corruption with the meta data. I ended up going back into the Derived Column Transform, renamed the column in error, then added a new derived column with the old name. I saved the transform, and then removed the original column. That fixed the problem.
Thanks for the responses.

Did you add the Derived Column into an already existing transform chain?
If you did then there's a good chance that one of the transforms further down the queue is set to not pass on this newly derived column. Check all the transforms below and make sure that you're derived column is set to be passed through.

Related

sm30: Set matching column heading

I created a table in SAP via se11, then I used the table maintenance generator.
Now I edit the table via sm30:
The second and the third column: Both have the heading "Feldname".
The first "Feldname" column is called COLUMN_NAME and its data element is "Fieldname".
The second "Feldname" column is called AUTH_FIELD and its data element is "XUFIELD"
I would like to see the column names which I gave the columns in se16 (COLUMN_NAME, AUTH_FIELD) in the heading.
How to prevent the table maintenance generator from giving other names in the headings?
Option 1 - use custom data elements:
Instead of using Fieldname and XUFIELD data elements, you can create your custom data elements and give them what header you would like.
(You will have to regenerate table maintenance)
Option 2 - editing screen
When generated the table maintenance, you supplied a function group and a screen number.
Go to SE80 -> Function Groups -> <function_group_supplied> -> screens -> <screen_supplied>.
Then edit it as you want.
Note: Modifying a generated object is considered risky. Your customized changes might be overwritten in a future regeneration.
Add custom data elements with suitable descriptions. Let the new data elements refer to the original ones (resp. the domains) to avoid having to reinvent everything.
Data element descriptions can be translated.
You can set different descriptions for different lengths, e.g. "Field" for the narrow column with length 10, and "Field name" for a wide label with length 30.
Regenerating the maintenance screen won't accidentally delete the changed descriptions.

SSRS SQL report builder deleting column

I have a problem with SSRS report builder. Basically what I want to do is to delete a column. I have a report that someone else made and there is 1 column (xxx) that no longer exists in data source tables so I need to delete it.
When I go to query designer and delete this column from the code and run it there, it works. I close query designer window and see that list of columns (fields) is updated now and xxx column is not there. Then, I delete this column manually in designer (default screen) and when I try to run the report, It doesn't work:
"The Value expression for the text box ‘XXXDataField’ refers to the field ‘xxx’. Report item expressions can only refer to fields within the current dataset scope or, if inside an aggregate, the specified dataset scope. Letters in the names of fields must use the correct case."
But that field should be already deleted. So I don't know what else I can do, or what it can be linked to. I just want to delete it. Any Idea?
Thank you
If your dataset does not contain xxx but your DataTable has this error is normal
You either delete that column from your table or at lease delete DataSet Binding from table so that SSRS does not try to retrieve that column from DataSet
It will be a reference to the field in another field. For example, if you deleted a column that showed an OrderShipped status, then you might have another text box highlighted based on this.
The error is telling you which textbox is in error. So, click somewhere on the designer, then in the properties window, right at the top, click the dropdown which allows you to choose specific report items, choose XXXDataField (the one named in the error message) and then check the value expression. In there you will find the reference to the column you deleted.

OpenRefine columnwise scripting

I spent some time Googling, but couldn't find anything useful.
How to select all the values of a single column in OpenRefine in a script?
It seems that all the operations are row-wise
In particular, I want to find highest and lowest values in a column
By default, OpenRefine functionality are limited for computation. The Stats Extension make basic stats per column (min, max, average, medium ...).
Facets will give you a list of all the values in a column - so the simplest way of getting the lowest/highest values in the column is to make a facet on the column and see the resulting highest/lowest in the facet to get the answer.
However I'm not sure if this meets your criteria for selecting the values 'in a script'. By this I assume you mean you want to be able to access the lowest/highest values in a GREL expression?
You can do this, but you have to force OpenRefine to treat all the rows in project as part of a single record. The easiest way to do this is usually to add a column at the start of the project which is empty except for the first cell which contains a value.
Once you've done this you can access all the values in a column by using syntax like:
row.record.cells["Column name"].value
See also my answer to OpenRefine - Fill between cells but not at the end of the list which uses the same technique
Further explanation:
Create a new column at the start of your project and put a single value in the very first cell in that column
Switch to Record mode
At this point you should have a single 'Record' in your project - e.g.
At this point using the syntax like row.record.cells["Column 1"].value gives you an array of all the values in "Column 1". You can then use GREL expressions to manipulate this - including sorting or comparing values.
A Text Facet has an nice undocumented option to gives you aggregated results in a column that you can just copy and paste.
Click on the "X choices" in the upper left corner of the Text Facet box.
This will bring up a separate dialog that contains the values along with the count of each value in that column.
(If your looking to just get ALL the values of a single column, then use Export -> Custom Tabular Exporter and then Select and Order Columns to Export by clicking on checkboxes, then click on Download tab to choose your export format and then click Download button.)

MS Access: Conditional formatting - highlight duplicates

Is there an expression that I can use in MS Access ,to highlight Duplicate entries in Reports?
I tried something like Expression is : Count(*)>1 but it doesn't work.
Br,
I suspect that the original query will need to be bulked up with a sub-query that has an ID column and count of ID. The outermost query will then need to also return the ID count.
Within the report you'd then need add another field that would show the linked ID count if it was > 1.
Access reporting (and forms) allows conditional formatting to be used in a similar way to excel.
See Ribbon: Report Design Tools>Formt>ControlFormatting...
It will let you change the format of a control depending on the value it, or another control, contains.
It's a very nice feature and will also let you add bar charts to you list forms to graphically represent the values sorted in a control.
However, the data set will need to have a column that indicates whether the current row has duplicate records. The snippet from you current query that you provided (that I repeat below) will not do this:
...OR (((Object.Key) In (SELECT [Key] FROM [Object] As Tmp GROUP BY [Key] HAVING Count(*)>1 )));
Without seeing the whole query I can't really help much, but you will need to remove the use of IN and make the SELECT statement a subquery of the main SQL Statement. The main query resultset will need to be LEFT JOINED to the sub query using the Key field. Because of the LEFT JOIN you can use "isnull(Key)" in the SELECT clause and isnull(Key) will be true for non-duplicate rows.
You can then refer to thiscolumn in your conditional formatting
I hope this makes some sense.
You
For a quick and dirty way to highlight duplicate data:
Select the object you want to highlight if it's duplicated, and make
the background white (or whatever the colour of your background is).
Create a copy of the object that you want highlighted if it's
a duplicate.
Format the copy so it has a highlight, and/or add extra text
(eg: DUPLICATE)
Put the copy behind the original (so it can't be seen).
On the original object, select "Hide duplicates" in properties.
Ensure "Hide duplicates" is NOT selected on the copy.
So when the duplicate appears, Access will hide it, but then the object you've created that was originally hidden beneath now becomes visible - effectively highlighting the field.
(Unfortunately it will only highlight the field itself, not the entire section.)

Reporting Services - hide table column based upon report parameter

I have a report in Reporting Services 2005, and I want to hide or show a single table column based upon a report parameter. Does anyone have any idea how to do that?
Thanks!
Use the visibility property of the column. This worked for me.
=iif(Parameters!ParameterName.Value = "TextValueOfTheParameter",False,True)
Set the Visibility for the column to an expression which will return true or false. This property can be found on in the Visibility tab on a TextBox for example.
Click the radio option for Expression and then your expression might look like
=Parameters!ShowColumn.Value
Tip: If the expression returns "False" then the column or row will be visible. If the expression returns "True", the expression will be hidden. This tricked me at first.
Let’s say my report(SSRS 2005) have 5 columns. And I want to show/ hide columns based on a parameter(multi select with all 5 column names) selected by user. do as following
1)Create a parameter of type string (ColumnVisibility is name of my parameter) with desired column names in labels for the 5 columns and INT number(01,02,03,04,05) respectively in the values in “Available Values” section of the parameter wizard.
2) Then Go to column Properties on design . Go to “visibility” and paste following
=iif(instr(Join(Parameters!ColumnVisibility.Value,","),"01")>0,false,true)
3) repeat same for all the columns, by increasing the int value by 1..see following for example
2nd column
=iif(instr(Join(Parameters!ColumnVisibility.Value,","),"**02**")>0,false,true)
3rd column
=iif(instr(Join(Parameters!ColumnVisibility.Value,","),"**03**")>0,false,true)
And so on. For SSRS 2008, when you right click on the column you can see "Column Visibility" option. paste the code in "show or hide based on an expression" section for each column.
For some of my reports I've set the Visibility (Specifically the Hidden property) for the column to:
=IsNothing(Fields!Site.Value)
Note that this only works if the relevant field can be null in the underlying dataset, otherwise you will see the blank column.
If you want to hide whole column, when there are no data at all for that specific column in the report, you can use following code in the column visibility/expression:
=IIF(IsNothing (Sum(Fields!columnA.Value, "ReportA")),False,True)
when I do as above, I can make the column disappear but it leaves a gap in my table. Is this the expected result. I was hoping the columns would also shift over. I'm trying to hind a column for one group and then display it for the next group.
To make a null column disappear,
Right-Click column to select Column Visibility, then Set expression for Hidden:
IIF(IsNothing(Fields!FieldName.Value),True,False)