Tableau data source column name changed when using a duplicated view from database (Teradata) - teradata

I was using a view (VW_NEW_CUSTOMERS) in Teradata and all the column names had an underscore in it. The column names in tableau did not contain underscores.
For example:
Customer_Number (From Table View)
Customer Number (From Tableau Column Name)
Now I created a duplicate of the view (VW_NEW_CUSTOMERS_2), all the columns have the underscore in Tableau. So when I use replace data sources, the column name mapping is completely different from the above because of the underscores.
New Tableau fields from duplicated View:
Customer_Number (From Table View)
Customer_Number (From Tableau Column Name)
I would like to know why the underscores did not appear 1st time and it is now appearing when I duplicated the view. How can I rename the fields so that it comes like the 1st time? Should I do them manually now?
Note: Database columns were using aliases

Check this thread, this isn't new, Tableau decided to start renaming fields some time ago. Not sure why it would have done on one of your data sources, but not the other.
Anyway, the exec summary, you may need to reset the field names of the version without the underscore, which should bring the underscore back into your data, making both data sources the same. To do this, copied from the thread:
"Version 9.3 and 10.1, you can select all the measures (and dimensions) in a worksheet, right click and "reset names" in two operations"
I think there's also a way to hack the xml to add the spaces to your copy, should that be preferrable. The thread covers hacking the xml to remove spaces, therefore I assume to add spaces do the same but in reverse.

Related

Create wikidata items from records in OpenRefine (and not rows)?

I read that OpenRefine Wikidata plugins always operates in row mode.
I am in a situation where I have data in records mode : The record is a serial/magazine, and the rows in this records are the various formats of the same serial/magazine (typically, paper and electronic version). Each row has a unique ISSN identifier.Wikidata considers there is only one item for the serial/magazine (my records), but no separate items for each of the formats (my rows).
When reconciling data to Wikidata, all rows of the same record will typically match the same wikidata item, or none of the rows will match, or sometines only one row of the record will match (e.g. if only one ISSN of the format - say paper format - is known in Wikidata, but not the others).
What I would like to do is create items in Wikidata for each records for which no reconciliation result was found (iow, for which no rows has matched), and not for each row. And, when creating this item, I would like to add the ISSNs of all the rows in this record.
I am wondering if it is possible to do that ? and how ?
Thanks
Yes, it is possible. You need to perform the reconciliation operation on the first column instead.
As mentioned by the documentation, use the Fill down operation on the first column, which defines your records;
Reconcile the column to Wikidata;
Then, the Create one new item for similar cells action (in the Reconcile -> Actions menu)
Create a schema where the first column is used as subject id.
Assuming the values in your first column are initially distinct (which is the case in your example), this will create one item per record.
In your example, because your first column contains ISSNs and not titles, I would first create a root column with titles instead (before the process explained above). In rows mode, facet to keep the first row of each record by selecting non-blank values in the first column, and then copy your column with titles, and move this new column in first position. This should ensure that reconciliation picks up existing items. Note that if the same title is used by multiple journals this will create a single item for both of them, unless you add other properties in your reconciliation configuration (such as ISSN).

How to get a range of columns as collection?

EDIT: For context, I am trying to import a certain range of columns in an Excel sheet into a Blue Prism object as a collection.
So I've got a worksheet with columns from A to AM. When I get sheet as collection, blank columns named "Column1" to "Column10" (the first time) and "Column1" to "Column19" (the second time, note its 19 cols this time) mysteriously appear in the collection. No data is in these columns - no whitespace, nothing.
In order to prevent anything of the sort from messing up the collection cols, I'm looking for a way to get a range of columns as a collection, e.g. A - AM. The number of rows is undetermined, so the get range as collection action is not suitable. Thanks in advance!
I never really liked the default object to get range as collection because of that. You can create a new action in the Excel VBO object (do make sure to be careful with that since re-importing the default object will basically erase the action. I usually rename it as 'MS Excel VBO Customized' or something along those lines).
The way I would do it is as follows:
Open the 'MS Excel VBO' object and duplicate the page 'Get Worksheet Rage as Collection' and name it 'Get Worksheet Range as Collection New' (or anything you deem suitable):
Edit the code stage: give it a new name (because code stages cannot have the same name in the same object) and change the inputs and code stages to match the following (I'm calling the new range as 'Address' here, but feel free to name it something else as long as you are consistent throughout):
Edit the start stage. You can delete the previous data items for Start Cell and End Cell and create one for Address:
Publish and save the object. You can then use it from the object or process you are working on and use a range such as A:AM.

Deleting duplicate rows in MS ACCESS

I am making a table by combining columns of two tables. But there are few duplicate rows also. How do you delete duplicate rows from MS Access. I tried using the duplicate record query and also tried to use append query. But neither of them worked.
There are a couple of ways you can do this without using the Access wizards:
1. Run a Make Table Query and in the select statement use grouping for every column. If the tables have a unique ID, don't use the ID because that will make every record unique
2. Export a Select query with the columns you want from the two tables to an Excel workbook. Once in Excel go to the Data tab and click on the column header selector and click on the Remove Duplicates button. Make sure you expand the selection if it asks you. Then save and link the Excel Workbook to Access again and do whatever you need to do from there
There are more ways, but you'd have to provide more details as to what you're trying to accomplish

Using 'Filter by Column Value' and multi column filtering using a java vector - xPages

I have an xPage which I have built with 3 combo boxes and 1 view control. I would like to use the 'Filter by column value' option within the view control to provide the options to filter the values, allowing the user to display any combination of the combo boxes. e.g. Only comboBox1, or comboBox1 and comboBox2, or comboBox3 only, or comboBox1 and comboBox2 and comboBox3.
I used the example in the 'xPages Demonstration Application' (http://www-10.lotus.com/ldd/ddwiki.nsf/dx/xpagesdemoapp.htm or http://xpagesblog.com/XPagesHome.nsf/Entry.xsp?documentId=AAC8E26599256FDC852578CB0066CC13) to do the multi-column filtering using a vector of non-categorized columns.
So, I have come across what appears to be a fairly major issue whereby the data needs to be sorted by date. Date is not one of the filters, but it needs to be the first column in order for the data to be sorted correctly. So my first column is a string, YYYYMMDD, to ensure the data is sorted correctly. I tried to use the sort option within the view control and that does not appear to work with the column filtering implemented in this manner.
So, as Date one of the criteria I am filtering by, I have passed that as an empty string - using the thought process that an empty string will select all (as in the url examples above).
The code I have used to do the filtering is:
var vtr:java.util.Vector = new java.util.Vector();
var t1 = sessionScope.Email;
var t2 = sessionScope.Own;
var t3 = sessionScope.Module;
vtr.addElement("");
#If(sessionScope.Own=="My calls",vtr.addElement(t1),vtr.addElement(""));
#If(sessionScope.Own=="My calls",vtr.addElement(""),vtr.addElement(t2));
#If(sessionScope.Status=="Open",vtr.addElement("Open"),vtr.addElement(""));
#If(sessionScope.Module=="All",vtr.addElement(""),vtr.addElement(t3));
return vtr;
What I have found is that not all data is being returned. I thought this might be due to the date field. So I removed it (changing the view and removing the first add element), and yet I still find that not all data is being returned. I suspect that this might be due to the empty strings being passed, or, that this does not actually work the way I had hoped.
Does anyone know if I can get this working the way I want it to, and if not, do you have any suggestion on how I can go about this?
Date is not needed as the first sortable column in the view. The first column does need to be sorted for the lookup to work just like the Notes view needs to be sorted for #DbColumn and #DbLookup to work. XPages uses the same underlining architecture. This example - http://dev.openntf.org/demos/demoapp.nsf/viewFilteringVector.xsp - works without the data being sorted by Date.
My guess as to why your example isn't working is down to how your Notes view sorted. Try creating a new view with column 1 (email) ascending sort, column 2 (own) ascending sort, and column 3 (module) again ascending sort. You should be able to get vector filtering working in this situation.
If all that doesn't work for you, you might consider multi-layer category filtering (new to 853). This filtering type in XPages is related to how categoryFilter works but allow you to filter a view by the sub-category (or sub-categories) too. This technique might suit your scenario better. Hope this helps.

Display CSV dynamically in MVC3 view table

A data provider is giving us dynamic report data in a SQL Server database table X. There is also a metadata table Y which holds the report count and the columns (as a semicolon separated string). In the report data table X, there is a text field which holds all the data, separated by semicolon. The provider is doing this to be dynamic, and I can't influence that choice.
I need to:
Load the metadata from Y
Load the data from X for a selected report from Y
Display the data in a table on a webpage
How would you go about reading this in the model/controller and displaying it in a webgrid/table? For models with fixed columns, this is simple, but what about when the columns are dynamic?
Current solution (feels dirty) is to parse the data into a DataTable and manually output rows and table cells in the view from this object. No use of WebGrid, MvcContrib Grid etc.
I chose to parse the table data into a specific dimensional model in my MVC application:
Base objects
Report
Column Definition
Data Row
Report has a list of column definitions and a row count integer. It also has a list of rows. Each row has a list of column values (cells), which is always treated as string in this code, and only displayed using the display data type from the column definition.
My data types defined are for example: text, date, number, link (many types of links to our CRM system, accountlink, userlink, orderlink). I add new data types only if I need to display them differently than the existing ones. I can imagine some day I need a chart data type (where the cell data is a list of plot points for example).
This makes the report definition very flexible, but I am probably sacrificing some performance and it is purely custom. I would still like input on this approach, but no responses in the last 6-7 months probably means this is a weird enough scenario that you, the reader, should avoid.

Resources