Join tables in Spotfire in a third new table - join

I have two data tables tab1 and tab2 that I want to join.
I know how to do it with the insert columns property, however it is not what i really need. I want the result to be stored in a third new table tab3.

Add new data table, add from current analysis (scroll down). Select table 1. Name it table 3. Now insert columns to table 3 from table 2. At the end of this you will have 3 tables.

you can Add New Data Table From... Current Analysis>>[your existing data table] to create a reference or "virtual" table. any structural changes made to your referenced (original) table will propogate to the referenced (new) one.

Related

Creating columns in table by using records of another table

I want to create table B in database, table B will contain columns same as the records of particular column in Table A. Means I have to create Table B with columns same as records in Table A. How to do this? Suggestions please? This is the desired table from which i want to copy records of one column and add to another table as columns

Spotfire v7.5 : Edit Existing Data table join

In Spotfire, I have inserted columns From an Excel File in an existing Data Table on Spotfire (See example shows at the End) but I have made a mistake in the join property. Could I change it without re creating the complete Data Table or using calculated columns/Filters?
You can only edit it by deleting the inserted columns and adding them again.

Rails where two tables have the same data?

I'm trying to create a table in my view and populate it on some conditions.
I have two tables, Both have two columns inside, One columns called event_url and the other is gmiurl. The table with gmiurl inside is called GMITable and the other is called newevent
Basically i want to show everything inside the GMITable unless the column event_url has a url inside that matches to any of the urls inside gmiurls inside the GMITable
I dont have anycode for this apart from this at the moment
#GMI = GMITable.all
You can easily achieve the result by using a LEFT OUTER JOIN from Table A to Table B, as described in this visual explanation.
Specifically, what you want is:
To produce the set of records only in Table A, but not in Table B, we perform the same left outer join, then exclude the records we don't want from the right side via a where clause.
In your question is not clear how the tables are called, and how they relate each other. However, to achieve the result simply perform a join between the tables using the ActiveRecord join method
TableA.joins('LEFT OUTER JOIN TableB on TableA.field = TableB.field')
and select only the items where(TableB.id IS NULL).
You'll have to adapt the example to your needs.

How to show selected items of certain table on the different table in Dynamics AX 2012?

So, I have two tables InventTable (for inverntory) and MyCartTable. I want to connect this tables so when I chose some item or items in InventTable to show in MyCartTable's grid. MyCartTable fields are ItemNumber, ProductName, PartyID;
Assuming you are working with AX 2012:
On your MyCartTable, remove the itemNumber field.
Open an other AOT windows go to Data Dictionary - Extended Data Types and locate the itemId data type. Drag and drop this data type on your table. AX will ask if you want to add a foreign key relation. Click yes, this will add a relation to the InventTable to the relations node of your table.
Now on your form, set the JoinSource property of your MyCartTable to you inventTable data source.
If you are having trouble making this work, create a new form with only those two datasources and a minimum amount of controls (like just 2 grids), this allows you to test this more easily.

DB grid : How to use a column of the current row of one as an index into another?

I am not sure if the question title is clear enough, please feel free to edit it.
Basically, I have two DB grids which reflect two database tables, each grid showing one.
When the user selects a row in the first table (let's call it oders), I want to update the second with details of any rows matching a column of the selected row of the first table.
Say, for instance that table orders has a column customer_id and I want to populate the second table (let's call it order_details) with details of all orders from that customer, one order per row.
I can connect up 2 # datasource, query and connection to the two TDbGrids, but I am stuck as to how to code order_details SQL.
The SQL for orders is just SELECT * from orders, but the other?
I want something like SELECT * from order_details WHERE cutomer_id=<orderQuery>.currentRow.FieldByName("customer_id").AsInteger - but I don't know how to do that ...
Can someone help me with some Delphi code?
Also, once I set up that relationship, will selecting a new row in the orders DB grid automatically update the order_details DB grid? Or do I need to add code for that.
P.s I know that there is no books tag anymore (more's the pity), but can someone recommend a good book which explains the fundamentals of programming DB aware controls? I obviously need one. Thanks
Use a parameterized query for the detail (child) database:
SELECT * FROM Order_Details od WHERE od.CustomerID = :CustomerID
Then set the child query's MasterSource to the parent (Order) datasource, and the MasterFields to CustomerID. (If there are multiple columns that link the two, separate them by ;, as in CustomerID;OrderNumber.)
Every time you scroll the parent (change the selected record in the parent DBGrid), the child query will be executed with the ID of the parent row passed as a parameter automatically.

Resources