Run a search with selected columns only
Devo offers the option of selecting only the required columns from a data table when running a search, allowing you to quickly and easily focus in on the data that matters to you. This function means that you select only the columns you wish to work with and is distinct from hiding columns. Once you have applied the selected columns, the unselected columns are not displayed in the search window.
Selecting specific columns in LINQ
To get going, open Data Search and click on the Free Text Query option. Here you can build your query using LINQ.
In this example the data table is
demo.ecommerce.data and you only want the
from and the table name, followed by
select and the columns you want to appear. If needed, remember that you may add a new name to the column using the operator
as. If you don't know the column names, or the table has a large number of columns, click on the Show Table Fields button and the list of columns will appear on the right.
Use the filter to search for the names of the columns if you cannot see them at a glance. Clicking on the headings Name and Type will organize them into their respective alphabetical order.
Alternatively, you can give new names to the columns using the operator
as. The columns will only appear in the search window under their new names:
select column1 as name
select column2 as name
Below you can see that—having unchecked Select All Fields—only the selected columns are displayed, which in this case are
Selecting only the required columns differs from running a query with a data table and later hiding columns. Using this method, you can only hide and display the columns that you have selected when running the initial query. Take a look below to see how this works.
Using the same logic, if you return to the table in the applied query operations bar you will notice that none of the columns from the original table will be displayed. This is because your original LINQ query specified that only certain information be shown.
Selecting specific columns with the Finder
Tables with a large number of columns can be cumbersome to work with when using the search window and, often, many of the columns will not be relevant to the query you want to create. In this case, you can select the columns that you want to show in the search window before opening the table.
To do this, select the vertical ellipsis on the final level of the tag and choose Select Columns. This opens a window that lets you select the columns you want to show. All columns are automatically checked, if you manually uncheck a column then it will not be displayed. You can also reorder the columns by dragging them to the required place. Click Apply and the table opens in the search window showing only the columns you selected.
Use the filter to search for the names of the columns if you cannot see them at a glance. You can also modify the order of the columns by clicking and dragging. Clicking on the headings Name and Type will organize them into their respective alphabetical order, but this will also reset any modifications to the column order.
Once you have selected the columns you want to display, the search window will be filled out accordingly. You can modify the selected and unselected columns via the Toggle Query Editor tool. Click on the Show Fields button to see all of the available columns in the data table.
Operations using the Free Text Query
Devo allows you to run operations directly from the Free Text Query, with the process functioning just like selecting specific columns in LINQ as detailed above.
select operation (column)
You can run multiple operations at once but the data returned cannot be used for further operations, such as alerts, etc.
Leaving the Select All Fields option activated while simultaneously selecting specific columns will result in all of the table's columns being displayed, with the selected ones being duplicated at the end of the other columns. This function can be useful if you wish to duplicate the information contained in a certain column and display it under a different name. In that case, you can enter the following free text query:
select column1 as name
select column2 as name
The original columns will still be displayed but the duplicates, under their new names, will appear near the very end of the query. In this example we again use the table
demo.ecommerce.data and want to rename the
eventdate column as when and the
method column as how. We leave Select All Fields activated.
If you open a data table using the Finder option without selecting any columns, then all of the columns are shown in the search window. Therefore, if you later select a column using the Toggle Query Editor this simply creates a duplicate which is added at the end of the other columns. You can use this function as above to duplicate existing columns and give them new names.