Merge UnTyped DataSets to Typed DataSet - strongly-typed-dataset

i have two datatable in Typed DataSet
named tblA and tblB
note: both the table is having different data structure.
let me know how to merge two untyped dataset to the above typed dataset.
Dear Tony,
Thanks for your effort.
But please understand my question.
I have 2 DataTable in Typed DataSet
DataTable names are: tblA and tblB
Now i have to merge Untyped Dataset one by one.
i need to map and merge.
Like:
UnTypedDATASET.TABLE("TABLEONE")
NOW LET ME KNOW HOW TO MERGE THIS WITH TYPEDDATASET.TABLE("tblA")
i did like this: TypedDataSet.merge(DS.table("tblA"))
but its mapping to tblB instead of tblA
Expecting your valuable help.

Got a solution to merge UNTYPED DATASET WITH TYPED DATASET
Typed_DS.Tables("tblA").Merge(UnTyped_DS.Tables("tablename"), True, MissingSchemaAction.Ignore)
Regards,
Thiru.

myTypedDataset.Merge(myUntypedDataset)
Not being funny but this is two second google.

Related

How to speed-up a spatial join in BigQuery?

I have a BigQuery table with point registers along a whole country, and I need to assign a "censal zone" to each one of them, which polygons are contained in another table. I've been trying to do so using a query like this one:
SELECT id_point, code_censal_zone
FROM `points_table`
JOIN `zones_table`
ON ST_CONTAINS(zone_polygon, point_geo)
The first table is quite large, so the query performes very inefficiently as it is comparing each possible pairs of (point, censal zone). However, both tables have a column identifier for the municipality in which they are in, so the question is, can rewrite my query in some way that ST_CONTAINS(*) is performed for each (point, censal zone) pair that belongs to the same municipality, hence not comparing all posible censal zones within the country for each point? Can I do this without having to read points_table multiple times?
SELECT id_point, code_censal_zone
FROM `points_table`
JOIN `zones_table`
ON 1.municipality = 2.municipality
AND ST_CONTAINS(zone_geo, point_geo)
I'm quite new to BigQuery so I don't really know if a query like this would actually do what I'am expecting, as I couldn't find anything in the documentation.
Thanks!
SELECT id_point, code_censal_zone
FROM `points_table`
JOIN `zones_table`
ON 1.municipality = 2.municipality
AND ST_CONTAINS(zone_geo, point_geo)

Combine Tables matching a name pattern in Power Query

I am trying to combine many tables that has a name that matches a patterns.
So far, I have extracted the table names from #shared and have the table names in a list.
What I haven't being able to do is to loop this list and transform in a table list that can be combined.
e.g. Name is the list with the table names:
Source = Table.Combine( { List.Transform(Name, each #shared[_] )} )
The error is:
Expression.Error: We cannot convert a value of type List to type Text.
Details:
Value=[List]
Type=[Type]
I have tried many ways but I am missing some kind of type transformation.
I was able to transform this list of tables names to a list of tables with:
T1 = List.Transform(Name, each Expression.Evaluate(_, #shared))
However, the Expression.Evaluate feels like an ugly hack. Is there a better way for this transformation?
With this list of tables, I tried to combine them with:
Source = Table.Combine(T1)
But I got the error:
Expression.Error: A cyclic reference was encountered during evaluation.
If I extract the table from the list with the index (e.g T1{2}) it works. So in this line of thinking, I would need some kind o loop to append.
Steps illustrating the problem.
The objective is to append (Tables.Combine) every table named T_\d+_Mov:
After filtering the matching table names in a table:
Converted to a List:
Converted the names in the list to the real tables:
Now I just need to combine them, and this is where I am stuck.
It is important to not that I don't want to use VBA for this.
It is easier to recreate the query from VBA scanning the ThisWorkbook.Queries() but it would not be a clean reload when adding removing tables.
The final solution as suggested by #Michal Palko was:
CT1 = Table.FromList(T1, Splitter.SplitByNothing(), {"Name"}, null, ExtraValues.Ignore),
EC1 = Table.ExpandTableColumn(CT1, "Name", Table.ColumnNames(CT1{0}[Name]) )
where T1 was the previous step.
The only caveat is that the first table must have all columns or they will be skiped.
I think there might be easier way but given your approach try to convert your list to table (column) and then expand that column:
Alternatively use Table.Combine(YourList)

I would like to compare data between tables

I would like to compare data between two tables say source and destination and output the difference,
the problem is there's a mapping table which stores the columns of source table and corresponding columns of destination.
For example,
Table: T_MAP
SourceTableName SourceTableColumns DestinationTable DestinationTableColumn
s_t1 s_t1_col1 d_t1 d_t1_col1
s_t1 s_t1_col2 d_t d_t1_col2
s_t2 s_t2_col1 d_t2 d_t2_col1
....
So the question is how to compare the data between two tables with the map table.
Current idea is using dynamic cursor to generate dynamic sql statement, then using minus+union all to compare data. But the performance may be a big problem.
Is there any thoughts?
Please help..
Thanks in advance.

Parse relational type query - swift 3

I've got 2 classes
Reports - objectID, Title, Date & relationItem ( Relation type column linked up to Items)
Items - ObjectID, Title, Date etc
I want to query all the Items that are equal to a objectID in reports. Users create reports then add items to them. These items are found in the Items table.
I've looked at the https://parseplatform.github.io/docs/ios/guide/#relations but don't see anything for swift3.
I've tried a few things with little success. This snipplet below i did find, but not sure how to apply it to my classes.
var relation = currentUser.relationForKey("product")
relation.query()?.findObjectsInBackgroundWithBlock({
Would love somebody to direct me into the right direction! Thanks
Tried this code below too!
var query = PFQuery(className:"Items")
query.whereKey("relationItem ", equalTo: PFObject(withoutDataWithClassName:"Reports", objectId:"MZmMHtobwQ"))
Ok so i had to change the table slightly to get this to work to prevent a query within a query.
I've added a relation Type to the Items table instead of the Reports Table
Then i managed to retrieve all the Items based of that report ObjectId like this:
let query = PFQuery(className:"Items")
query.whereKey("reportRelation", equalTo: PFObject(withoutDataWithClassName:"Reports", objectId:"3lWMYwWNEj"))
This then worked. Note that reportRelation is the Relational Type Column.
Thanks
When you’re thinking about one-to-many relationships and whether to implement Pointers or Arrays, there are several factors to consider. First, how many objects are involved in this relationship? If the “many” side of the relationship could contain a very large number (greater than 100 or so) of objects, then you have to use Pointers. If the number of objects is small (fewer than 100 or so), then Arrays may be more convenient, especially if you typically need to get all of the related objects (the “many” in the “one-to-many relationship”) at the same time as the parent object.
http://parseplatform.github.io/docs/ios/guide/#relations
If you are working with one to many relation, use pointer or array. See the guide for examples and more explanation.

Merge in h2 database, how to use it?

How can I use merge with sepecify row in H2? Any answers are welcome and I appreciate
I mean how to merge with the values passed from outside.
Example:
I wanna merge the row with name = "john" and id = "1" in table customer.
what the statement in this case
I'm not sure if you really mean the MERGE statement, but the documentation is on the web site.

Resources