Dynamic Column name

More
1 month 4 hours ago #22952 by hanisultan
Hello, 
What I'm trying to do is update an excel sheet - there is a column which I can use to match the values, in the case column Deposits and if the value matches, then I will update the date field based on previous date - AS you can see in the screen shot.  I can create the column name dynamically using dynamic SQL but would the tool adjust each day when the date changes and match it to the correct date?  Also, would I be able to insert the values based on what deposits are matching ( not sure how to phrase it) and if so how do I do that? If not my other options is order the fields in both the excel and the script and hope the values go in the correct fields?  As always, thank you for your help.

Please Log in or Create an account to join the conversation.

More
4 weeks 2 days ago #22953 by Peter.Jonson
Replied by Peter.Jonson on topic Dynamic Column name
Good morning

Thank you for using the support forum

Let me check my understanding.

You have two input fields deposit value and deposit date. 

If the deposit date matches any of the "date output fields" you want the deposit value to go into this "date output field" 

Is this correct?
 

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
4 weeks 2 days ago - 4 weeks 2 days ago #22954 by hanisultan
Replied by hanisultan on topic Dynamic Column name
Actually, the naming is bad here.  I'll have to input columns, deposits and a date going into an excel sheet tab.  The output is multiple columns, one of the deposits and the other is a date.  The deposits columns in both the input and output are for matching purpose, no insertion.  wherever they match then the date column from the input should be inserting the values in the corresponding date from the output fields.  I think the auto-link option should do it but not sure?  Also, I want to insert the data into an excel sheet in the column where the dates match see attached - so the insertion will start at row 7 under the column where the date matches 
Last edit: 4 weeks 2 days ago by hanisultan.

Please Log in or Create an account to join the conversation.

More
4 weeks 2 days ago #22955 by Peter.Jonson
Replied by Peter.Jonson on topic Dynamic Column name
Can we ask you to provide us with an Excel file example with two sheets?

Source data
Desired result

We will then create a working example for you.

Peter Jonson
ETL Developer

Please Log in or Create an account to join the conversation.

More
4 weeks 2 days ago - 4 weeks 2 days ago #22956 by Peter.Jonson
Replied by Peter.Jonson on topic Dynamic Column name
Thank you for providing the files

They helped us to understand what you are trying to achieve.

Please see the attached working example

File Attachment:

File Name: tmp.zip
File Size:22 KB


Screenshots





 

Peter Jonson
ETL Developer
Last edit: 4 weeks 2 days ago by Peter.Jonson.

Please Log in or Create an account to join the conversation.

More
4 weeks 2 days ago #22957 by hanisultan
Replied by hanisultan on topic Dynamic Column name
Thank you for this but it is not working.  If I run it, nothing gets inserted into the field.  If I run it with the output file that I downloaded from here, it shows the data there first but after running it, it disappear.  Also, I guess I have to manually type all the dates even though there will only be one date that will actually match?  The client will be running this script every quarter for multiple tabs so I guys I would have to have a transformation for each quarter.  
Attachments:

Please Log in or Create an account to join the conversation.

Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.