DATE
NAME
CX#
DATA
11/7/2021
Alex
CX55
1.34
11/7/2021
Linda
CX43
22.9
11/7/2021
Loki
CX109
3.43
11/8/2021
Alex
CX 12
23
11/8/2021
Linda
CX 113
2.49
What I am trying to do is, paste in a master sheet of data for a week, which is broken down by date, and by person. I need to formulate charts using data with a lookup where the data from Alex can be pulled and populated into another sheet for charting. Since the dates are going to be changing every week as new data is pasted/populated, I cannot do a normal vlookup and match based on unique static strings. Not only are dates changing, but even the names themselves day to day and week to week. Ideally I'd end up with something like this
DATE
NAME
DATA
11/7/2021
Alex
1.34
11/8/2021
Alex
23
using logic which is flexible enough to group when the data column is dynamic, as well as the name column. Maybe I am just not thinking if it in a way that makes sense with the functions available. Any guidance would help!
try:
=FILTER('Sheet1'!A:D, 'Sheet1'!B:B="Alex")
if your issue is that NAME column is not always under B column you can do:
=ARRAY_CONSTRAIN(QUERY({'Sheet1'!A:D,
FILTER('Sheet1'!A:D, 'Sheet1'!A1:D1="NAME")},
"where Col5 = 'Alex'", 0), 9^9, 4)
File Path :
'D:\TEST\Sales Data-20Nov2017.csv
Table1
EMP NAME SALES Till Date SALES 2015-16
A Sam 50 30
B Bob 40 60
C Cat 30 20
D Doll 20 50
E Eric 10 25
F Fed 15 10
How to Import csv file from Above path with dynamic date using SQL query?
Csv File contents above data
Kindly suggest SQL query using above path with dynamic Date
I have 2 CSV files with the same columns name i.e:
first csv:
Name Age
Alex 18
Yana 20
Nate 22
second csv (age column is empty):
Name Age
Alex
Yana
Nate
How to write batch script which will update empty column in the second csv by the first csv values?
Thanks
I have 2 tables with different number of columns, and I need to export the data using SSIS to a text file. For example, I have customer table, tblCustomers; order table, tblOrders
tblCustomers (id, name, address, state, zip)
id name address state zip’
100 custA address1 NY 12345
99 custB address2 FL 54321
and
tblOrders(id, cust_id, name, quantity, total, date)
id cust_id name quantity total date
1 100 candy 10 100.00 04/01/2014
2 99 veg 1 2.00 04/01/2014
3 99 fruit 2 0.99 04/01/2014
4 100 veg 1 3.99 04/05/2014
The result file would be as following
“custA”, “100”, “recordtypeA”, “address1”, “NY”, “12345”
“custA”, “100”, “recordtypeB”, “candy”, “10”, “100.00”, “04/01/2014”
“custA”, “100”, “recordtypeB”, “veg”, “1”, “3.99”, “04/05/2014”
“custB”, “99”, “recordtypeA”, “address2”, “FL”, “54321”
“custB”, “99”, “recordtypeB”, “veg”, “1”, “2.00”, “04/01/2014”
“custB”, “99”, “recordtypeB”, “fruit”, “2”, “0.99”, “04/01/2014”
Can anyone please guild me as how to do this?
I presume you meant "guide", not "guild" - I hope your typing is more careful when you code?
I would create a Data Flow Task in an SSIS package. In that I would first add an OLE DB Source and point it at tblOrders. Then I would add a Lookup to add the data from tblCustomers, by matching tblOrders.Cust_id to tblCustomers.id.
I would use a SQL Query that joins the tables, and sets up the data, use that as a source and export that.
Note that the first row has 6 columns and the second one has 7. It's generally difficult (well not as easy as a standard file) to import these types of header/detail files. How is this file being used once created? If it needs to be imported somewhere you'd be better of just joining the data up and having 10 columns, or exporting them seperately.
I have excel source and sql server table .
Excel Source column is
Mno Price1 Price2
111 10 20
222 30 25
333 40 30
444 34 09
555 23 abc
Sql server Table
Product table name
PId Mno Sprice BPrice
1 111 3 50
2 222 14 23
3 444 32 34
4 555 43 45
5 666 21 67
I want to compare excel source Mno(Model number) with sql server Product table Mno (Model number), and if it is same i want to update Sql server Product table SPrice and Bprice.
Please tell me what are the steps i want to do?
I want to validate that excel sheet also, because in excel Price2 column have string values
if it's string value i want to send mail which row data are wrong.
I am new for SSIS so please give me details.
Read your new data in a source, use a lookup component for existing data. Direct row matches to a oledb command for update, and a destination for your non-matches for inserts (if you want to enter new products).
Personally I think the simplest way to do this is to use a dataflow to bring the excel file into a staging table and do any clean up if need be. Then as the next step inmteh control flow have an Execute SQl task that does the update. Or if you need either an update or an insert if the record is new, use a Merge statement in the Execute SQl task.
You can use a Merge Join Transformation with a full outer join (remember to sort your datasets before they input to the Merge Join Transformation), then have the output go to a Conditional Split Transformation. The Conditional Split Transformation can determine whether or not a row needs to be updated, inserted, or deleted and direct the flow to the appropriate transform to do that.
This was off the top of my head, and there may be a simpler transform for this. I haven't had the opportunity to work with SSIS in almost a year, so I might be getting a bit rusty.