I've got a lot of data in an Excel sheet that I need reformatted. I am trying to achieve this by using Pivot Table but I'm not sure it is possible.
Here is current data set (SKU is unique currently):
I need it to look more like this (where SKU is NOT unique):
I'm willing to throw my current sheet into a MySQL database and query it if I can figure out a good query to utilize as well.
Any ideas on where to go from here would be appreciated.
It looks like you're wanting to unpivot your data (i.e. turn it from a crosstab into a flat file), although some of your desired output looks weird. Look at my answer to this question: convert cross table to list to make pivot table
Related
I am trying to create a chart from a cross-tab query that I have made. The row values of the chart are actually from a lookup field so instead of the actual value of the cell it shows the unique ID. I was wondering how you could make it show the actual value of the cell.
Thank you so much!
I am fairly new to using Microsoft access and haven't had any formal training except trying things here and there from an existing access database. So please excuse me if I seem clueless and need your help.
Make a query that is the join of your key table to the look up table. Save that with a name.
Then recreate your cross table query and instead of using the key table as its source, use your saved query. You will then be able to use the correct field in the rows.
I have 6 different input datasets. I want to run ETL over all 6 datasets so they all get transformed to the same output table (same columns and types).
I am using Pentaho (Spoon) to do this.
Is there a way I can define an output table schema to be used by all these transformations in Pentaho? I am using MySQL as my output database.
Thanks in advance.
Sounds like you need the Select Values step. Put one of those on the last hop of each dataset's path and make the metadata for the paths all look EXACTLY the same. Then you can connect the output from each Select Values step into a Table Output. All the rows from each set will be mixed together in no particular order.
This can be more challenging than it looks. Spoon will throw errors if any of the fields aren't just exactly identical to the corresponding field from all other datasets. You'll have to find some way to get all the metadata from the datasets to be the same.
I have joined 5 tables and done transformation on these tables. Now I got a single table at the end. Now I want to perform sql query on this single table to filter records. But I don't know how to perform simple sql query on this table. I have attached a snap shot which shows the resulting table. How I get this resulting data set as the source? I want to populate my destination after filter out this data.
I am using SSIS 2008.
Click here to see the Table on which I want to perform a simple sql query
SELECT * FROM `first_table`
where `some_column` =
(
SELECT `*`
FROM second_table
WHERE
`some_column2`='something'
LIMIT 1
)
Try this code This will help. You can even use this to connect all those four tables with each other.
From the image you posted, it looks like you have a set of data in the dataflow you're trying to query against. You need to do one of two things at this point. Either you insert the data into a table in the database and use another data flow to query it, or you use use a conditional split (or multicast and conditional splits) to filter the rows down further from there.
Without more detail about what you're actually trying to accomplish, these are the recommendations I can determine.
You could send the rows into a record set destination, but you aren't able to query it like a regular table and you'd need some C#/VB skills to access it to do more than a FOR EACH loop.
Assuming your sql query that you want to run against the resulting table is simple, you can use a script component task. By simple, I mean, if it is of this nature:
SELECT * FROM T WHERE a = 'zz' and b = 'XX' etc.
However, if your query has self joins, then you would be better of dumping the outcome of joining those 5 tables in to a physical table, and go from there.
It appears that query is going to be real straight-forward; in that case using a script component would be helpful.
A separate question: It's advisable to do the sorting at the database level. You are using 5 sort tasks in your solution. Can you please elucidate the reason?
I have a bunch of queries that I would like to dump directly to CSV. Everything works great EXCEPT there is no option to include the column names from the query (not necessarily the same as the underlying table column names). From looking around, it appears that doing a union with the column names is the only way to do what I want. My problem is:
How can I programmatically get the column names from my query?
The column names are not the same as the underlying table, so I cannot use the Information Schema.
Please let me know if you have any ideas or a better way to accomplish what I'm doing!
Thanks!
There's an article here:
http://giantdorks.org/alain/export-mysql-data-into-csv-or-psv-files/
That talks about sending SELECT output directly to a file and then modifying the text until it becomes a valid csv file. That seems to support column headers from the select statement.
I have two excel source 1st is giving me date value and 2nd is giving me price value from excel sheet.
Now i need to insert these two values into one table please tell me how can i do this?
I have used merge join but it is giving me error input must be sorted that i can't as it excel file.
Well personally, I would put each Excel file into it's own staging table. Then I would use a SQL query that joins the two tables as the source for my insert to the production tables.
After you get the input from each source, you have to sort it prior to merging it.
You can sort the input from an Excel source, from any source, because the sort is performed with the data on memory. Its an element in the Toolbar.
Check this:
http://msdn.microsoft.com/en-us/library/ms137653.aspx
I'm pretty sure you can define a sort on an excel