Merged DataTable Don't Copy To New Form - datatable

f I have 2 DataTables (dt1 and dt4) and I want to merge them and put them in another (dtFinal). How can I do this in vb.net?
I tried the Merge statement on the datatable, but the Problem it get the columns but not the value from the table
dt1 > Is manually written dt
dt4 > is Excel File loaded to dt
I Need to merge them to the new Form and them make Sum on the two qty Column
to get as image attached , but all working
Merged Two Table
Dim dtFinal As New DataTable
dtFinal = Frm_DiffLive.dt4.Copy
dtFinal.Merge(Frm_DiffLive.dt)
dtFinal.Merge(Frm_DiffLive.dt4)
Me.dgvFinal.DataSource = dtFinal
1- It Load All Columns From Two dataTAble
But Only Contents of DataTable Fills Manually
Not The One That Populated From Excel File ???
Do I Need To save it first to memory or something like that ?
2- how to make one column from the new dtFinal is the sum between Two column at each Row ??
f
I have tried a lot of merge lines , but i think as the columns appear correct, it's not merge problem

The beat solution was to save the two table to db first
Thene re- select it again anf do the whole required process.

Related

Additional row with empty header in matrix in power bi

The problem is probably trivial but unfortunately I can't figure it out. Here are two basics tables:
I tried to create the matrix based on the selected ID (from the Table2) with values from Table1. I created a measure "% Margin" (margin divided by revenue) and tried to add this to the matrix with ID from Table2. Every time besides ID from Table2 I got one additional row with empty ID. Anyone has an idea how to get rid it off? The rest of the matrix is correct.
Instead of using a separate static table, simply add a new column to you table and use that to filter your data for the report.
Here's how this would look like:

Create a summary table based on data from another table in Power Query

I am new and pretty inexperienced with Power Query, so have struggled with this issue and finding a basic tutorial on Power Query.
I am using Power Pivot to analyse some data. My source data is added to the Excel Data Model using Power Query from an external CSV file.
What I want to be able to do is create a summary table from the source data in a new table. This new table would be added to the data model. My source table (SrcTable) would look like this;
Order ID
Item Code
O-001
I-001
O-001
I-002
O-002
I-001
O-003
I-001
O-003
I-002
O-003
I-003
My new table would have two columns
A list of each Item Code
A Distinct Count of Order ID for each Item Code
So for the example above the SummaryTable would look like this
Item Code
Num Orders
I-001
3
I-002
2
I-003
1
Can someone please give me some guidance on how can I write a query to create this new table for me?
Thanks
Select your table using data...from table/range... to get it into powerquery
In powerquery
right click the Item Code column and choose Group by...
It should default to doing a count. You can change the name of the column from Count to Num Orders if you want. Then Hit Ok
The do File .. close and load to ... and decide how you want to get the data back into Excel. There is an optional [x] checkbox to add the data to data model

Insert a new Google Sheets row into Alphabetically Sorted spreadsheet

I am working with two spreadsheets; the first spreadsheet takes a name and then automatically adds it to the next spreadsheet which is sorted alphabetically by name. The problem is, I need a new row to be created, otherwise the data from the row above it gets added along with the name. Here is the query I am using: '=query(Referrals!A2:O, "select * where C is not null order by D")'. I don't think this can be done with a query, so I have been exploring Google App Scripts. I am not sure how to insert into the pre-sorted list, though. Any help is greatly appreciated!
Have you tried offsetting the header so you can run it for the range of the sheet?
=query(Referrals!A:O, "select * where C is not null order by D Offset 1")
That seems to fix some of the issues I've come across.
EDIT:
What about using a filter formula?
=sort(FILTER(offset(Referrals!$A:$O,1,0),offset(Referrals!$C:$C,1,0)<>""),4,true)
If using Apps Script, then you can directly insert a row (via Sheet.insertRows(rowIndex, numRows)) into the sheet at the desired index. But I believe you can achieve what you want by mapping the data in "next spreadsheet" to the names imported via "query" using VLOOKUP. That way when new data is added to "first spreadsheet" it will be sorted accordingly with your formula, but now the data associated will move rows to continue matching their respective row.

Instead of selecting a column to sort a table by in a dropdown, how do I add the sorting column names in a separate column?

I have a workbook where I have displayed a table where the user can view the top 3 IDs based on a column they can select from a dropdown (Measure A, Measure B, ... , Measure H):
Now, instead of this, I want to add a separate column called Sorting Criterion to the table that would store the column names with which the respective rows of the table was sorted. So, the expected output is something like this:
How do I do this? I'm open to using Tableau Prep Builder, if needed, for intermediate steps that may be too convoluted for Tableau Desktop.
Create a calculated field that just contains the Sort By parameter. Add this calculated field to your view.

Datameer - Add Columns to Joined table

I have joined some data from HDFS with some data from an Oracle DW, which is working fine, but I cant seem to add any new columns to this sheet. To add columns for calculated fields etc I have to duplicate the sheet and do it there - this doesn't seem overly efficient.
Am I doing something wrong here or can you not add columns to a join result sheet?
... but I cant seem to add any new columns to this sheet.
Right. It will not be possible to add columns to a JoinedSheet. It is a new data set containing columns from two or more sheets based on a key column which you defined.
... or can you not add columns to a join result sheet?
It will be necessary to reference these data as input for a new Worksheet by Duplicating Worksheet.
Another approach could be using datameer rest-api. You can get the content of the workbook in json format and add columns manually or by implementing a simple script, then update the workbook with changed json file.

Resources