How to query in database with GraphQL where to pluck only selected fields not all fields? - ruby-on-rails-3

I want to know if we can query to pluck selected columns and the request to the database to search for only those selected columns not the whole data at the endpoint. If there is any confusion in this question please let me know.

Related

PowerApps filter returning incomplete data record...?

I have an Azure SQL database, and my records inside table Spiderfood_RITMData in that database includes 13 different fields. Lots of stuff. I have confirmed in SQL-SMS that the records have data in each field.
There are way more items in the database than PowerApps can see using LOOKUP (1600-9000 records or more). However, I know FOR A FACT that there is only ONE record that has any given value in the NUMBER column. It's not a primary key, but it is unique in the table.
In PowerApps, I am trying to pull that field so that I can eventually parse out the individual items.
So, the commands I'm trying are:
ClearCollect(MLE_test1, Filter('Spiderfood_RITMData', "RITM2170467" in Number));
ClearCollect(MLE_test2, Search('Spiderfood_RITMData',"RITM2170467", "Number"));
However, the Collection results for MLE_test1 and MLE_test2 both are empty EXCEPT for the value of NUMBER. Say what?!
I'm trying to use the examples posted on https://learn.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-filter-lookup but I am honestly getting baffled by this.
How should I be formatting this call such that I can pull the whole record?
Big picture explanation: I need to do a lot of data LOOKUPS into my table Spiderfood_RITMData table, but it has way more than 2000 rows, and PowerApps will not perform the Lookup correctly. So my presumably smart idea is to create a MUCH SMALLER "version" of Spiderfood_RITMData as a local collection, using a more delegateable function (such as FILTER or IN). If I filter by all records containing the values of NUMBER, then I go from, say a 10,000-record SQL table to a 10-record Collection. And I can do LOOKUPS against that collection for the rest of the function (uh, I think -- I'm still trying to experiment accordingly). Please let me know if this is crazy or not.
LookUp is just used to get one record, instead try this:
ClearCollect(MLE_test1, Filter('Spiderfood_RITMData', "RITM2170467" = Number));
This gets a collection with all the items where Number is = to "RITM2170467"
Collections are limited to only 2000 records in each collections.
I had same issue. Go to App settings. Under Upcoming Features make sure Explicit column selection is turned off. Hope this does it for you.

How to Combine Multiple Tableau Columns

Let's say I have two columns in the data called
Functionality_First_Question and Functionality_Second_Question
Both columns have similar values
"approve", "functionality unclear", "functionality broken", NULL, etc.
Each row corresponds with a single, distinct review ID.
I thought about using Tableau combined fields to aggregate the data but will it end up turning into "functionality unclear, functionality broken".
I instead want just a distinct count of how many review IDs are associated with each answer to each question.
Let me know if this is unclear!
Depending on your data source, you can pivot the data in the data source tab:
highlight your First_Question, Second_Question, Nth_Question columns
right click
Pivot data
Now you have several records for each item (one record for each question) and you will be able to group all items by answer.
If this is not possible with your data source, one crude workaround would be:
Create a parameter Answer_param with the different possible answers
Create a calculated field that has a formula like
CONTAINS([First_Question], Answer_param) OR CONTAINS([Second_Question], Answer_param) OR ..
This will create a field that is True, if one of the answers contains the selected answer from your parameter.

row header in mdx queries

Can anyone explain how to add row headers to the following query? I'm sure there is a way, surprised that the column headers appear but the row headers are null.
By row headers I mean the top of the returned data, in gray that actually shows the name of the row returned.enter image description here
That is SSMS and the way it displays the data.
In MDX Studio we get this:
...but SSMS and MDXStudio are not front end clients so this is just the way they have been designed.
If you are using say Excel as a front-end then you will maybe use a pivot-table to display the data - column headers will be the same as any other pivot table
If you are using SSRS then you can name the columns in your Datasets.
Other front-end clients will deal with this differently.

Can you insert/update/delete rows in LinqPad via a grid?

Perhaps this is beyond the purpose of LinqPad, but does it have this functionality that is available in SQL Management Studio?
I want to seutp some quick data but don't want to have to write code to do it. I just want to type it in.
Yes, provided your tables have primary keys set.
All you have to do is put your results to data grids (Ctrl+Shift+G) then query the table you want to add rows to. If you're just adding rows and don't need to see existing rows, you can filter it out (YourTable.Take(0)). The key is to make sure that the query type is IQueryable<YourTable>.
You will be presented with a grid of the results of the query. There should be a button up top to Edit Data. There should be an empty row at the end (or you could click on Add Row) where you can enter your data.

Access 2010 Database Clenup

I have problems with my records within my database, so I have a template with about 260,000 records and for each record they have 3 identification columns to determine what time period the record is from and location: one for year, one for month, and one for region. Then the information for identifying the specific item is TagName, and Description. The Problem I am having is when someone entered data into this database they entered different description for the same device, I know this because the tag name is the same. Can I write code that will go through the data base find the items with the same tag name and use one of the descriptions to replace the ones that are different to have a more uniform database. Also some devices do not have tag names so we would want to avoid the "" Case.
Also moving forward into the future I have added more columns to the database to allow for more information to be retrieved, is there a way that I can back fill the data to older records once I know that they have the same tag name and Description once the database is cleaned up? Thanks in advance for the information it is much appreciated.
I assume that this will have to be done with VBA of some sort to modify records by looking for the first record with that description and using a variable to assign that description to all the other items with the same tag name? I just am not sure of the correct VBA syntax to go about this. I assume a similar method would be used for the backfilling process?
Your question is rather broad and multifaceted, so I'll answer key parts in steps:
The Problem I am having is when someone entered data into this
database they entered different description for the same device, I
know this because the tag name is the same.
While you could fix up those inconsistencies easily enough with a bit of SQL code, it would be better to avoid those inconsistencies being possible in the first place:
Create a new table, let's call it 'Tags', with TagName and TagDescription fields, and with TagName set as the primary key. Ensure both fields have their Required setting to True and Allow Zero Length to False.
Populate this new table with all possible tags - you can do this with a one-off 'append query' in Access jargon (INSERT INTO statement in SQL).
Delete the tag description column from the main table.
Go into the Relationships view and add a one-to-many relation between the two tables, linking the TagName field in the main table to the TagName field in the Tags table.
As required, create a query that aggregates data from the two tables.
Also some devices do not have tag names so we would want to avoid the
"" Case.
In Access, the concept of an empty string ("") is different from the concept of a true blank or 'null'. As such, it would be a good idea to replace all empty strings (if there are any) with nulls -
UPDATE MyTable SET TagName = Null WHERE TagName = '';
You can then set the TagName field's Allow Zero Length property to False in the table designer.
Also moving forward into the future I have added more columns to the
database to allow for more information to be retrieved
Think less in terms of more columns than more tables.
I assume that this will have to be done with VBA of some sort to modify records
Either VBA, SQL, or the Access query designers (which create SQL code behind the scenes). In terms of being able to crunch through data the quickest, SQL is best, though pure VBA (and in particular, using the DAO object library) can be easier to understand and follow.