How to select dynamical every month different source folder in SSIS - ssis

Scenario : Actual i want to see that one when Sep 6 only data load for source folder sep6 and tomorrow SEP 7 then data load form SEP 7 folder only then day after tomorrow SEP 8 mean data load from sep8 folder only but how ?????

I would do this by populating a variable from a C# script task. You can generate date/time strings very easily in a script task. E.g.:
Dts.Variables["User::FirstThreeCharsOfMonthNameUpper"].Value = DateTime.Now.ToString("MMM").ToUpper();

Related

importing csv into QGIS

So I am trying to transfer OSM data contained in a CSV document with OSM_way_id, OSM_start_node, OSM_end_node as columns, to QGIS. I want to represent this open street map data contained in the CSV as a map in QGIS. How do I do this? Please I need help.
Below is an example of the CSV when opened with Microsoft Excel. The CSV contains numerous rows and these columns:
Year
Month
Day
Hour
osm_way_id
osm_start_node
osm_end_node
speed_mph_mean
speed_mph_stddev
2020
03
08
18
8179128
1343922650
108500
9.599
2.439

SSIS-Variable File Name

I have a folder in which every month I will put a single excel file with name (depending on the month) like 'Jun file', 'Jul file', 'Aug file' and others. I want to move this file from folder to Sql database and form the table of the same name, that is 'Jun file'(if it is the June Month's file).
I am trying to do it through SSIS by forming the variable but I am unable to do it. How should I create the variable for this varying file name.

Use AppleScript to Duplicate a File to a Different Folder with a New Name

I am attempting to duplicate a file to a specified folder but I get an error:
error "Finder got an error: Can’t set file \"/Users/Andrew/Documents/Finances/Statements - Bank And Credit Card CSVs/2020-05-01 April 2020 Report/Steps/2020-05-01 April 2020 BEFORE STEP 01.xlsm\" to file \"/Users/Andrew/Documents/Finances/Budget Reports/2020-05-01 April 2020.xlsm\"." number -10006 from file "/Users/Andrew/Documents/Finances/Statements - Bank And Credit Card CSVs/2020-05-01 April 2020 Report/Steps/2020-05-01 April 2020 BEFORE STEP 01.xlsm"
I have to use AppleScript because I am initiating the script from within VBA. the part of the AppleScript that determines the 3 variables works as intended. For brevity the code looks like this:
DuplicateFileToStepsFolder("/Users/Andrew/Documents/Finances/Budget Reports/2020-05-01 April 2020.xlsm!/Users/Andrew/Documents/Finances/Statements - Bank And Credit Card CSVs/2020-05-01 April 2020 Report/Steps!BEFORE STEP 01")
on DuplicateFileToStepsFolder(ReportAndStepsPaths)
--code to split ReportAndStepsPaths into separate strings
set BudgetReportPath to "/Users/Andrew/Documents/Finances/Budget Reports/2020-05-01 April 2020.xlsm" --this is the file i want to duplicate
set StepsFolderPath to "/Users/Andrew/Documents/Finances/Statements - Bank And Credit Card CSVs/2020-05-01 April 2020 Report/Steps" --this is the directory I want to duplicate (or copy and move to)
set BudgetReportStepPath to "/Users/Andrew/Documents/Finances/Statements - Bank And Credit Card CSVs/2020-05-01 April 2020 Report/Steps/2020-05-01 April 2020 BEFORE STEP 01.xlsm" --this is the new file name
tell application "Finder" to duplicate file BudgetReportPath to folder StepsFolderPath
--line to rename the moved file would go here
end DuplicateFileToStepsFolder
Copy, move and rename would also solve my problem. I haven't tried to figure out the rename line. I am sure that there are no file name collisions either.
The problem is the Finder doesn't support POSIX paths (slash separated).
Either you convert everything to HFS paths (colon separated) with POSIX file or you use HFS paths anyway.
This is the HFS path version which specifies the base folder "Finances" with a relative path to
set financesFolder to (path to documents folder as text) & "Finances:"
set BudgetReportFile to financesFolder & "Budget Reports:2020-05-01 April 2020.xlsm"
set StepsFolderPath to financesFolder & "Statements - Bank And Credit Card CSVs:2020-05-01 April 2020 Report:Steps:"
set BudgetReportStepName to "2020-05-01 April 2020 BEFORE STEP 01.xlsm"
tell application "Finder"
set duplicatedFile to duplicate file BudgetReportFile to folder StepsFolderPath
set name of duplicatedFile to BudgetReportStepName
end tell

Custom Functions and accessing specific cells based on the location of the function

This community has been very helpful to me before and I am looking for answers again. I want to build a function that I can create once and drag-copy like the example below.
Jan Mon 1 "=CustomFunction()" -->Jan 1
Feb Tue 2 "=CustomFunction()" -->Feb 2
Mar Wed 3 "=CustomFunction()" -->Mar 3
I want the function to look for specific information in a specified column on IT'S specific row. Will .getActiveRange() accomplish this task and treat the function as the "active cell"?
I have not yet started the coding for this because I honestly do not know where to start with it.
Thank you again for your attention and assistance with this.

How to specify the report pdf name at run time?

I have a report named "Debt Report ". It runs for every month and a pdf is generated at the first of the month by subscription option.
If I am running the report for the month then the report name of the pdf should be "Debt Report for April" and like wise if I run it for may then the name of the pdf should be "Debt Report for May".
How can I do this?
Assuming you are scheduling the report to a file share, you can set the name of the file share to be Debt Report for #timestamp - this will name the file in the format Debt Report for YYYY_MM_DD_HRMINSS .
If you only want the month name (not the entire timestamp) to appear in the filename, you will need to use a Data Driven Subscription.
Another option, although a bit more technical, is to use the rs.exe utility to generate the report. This involves:
creating a script file that generates the report (this is where you can set the filename to your preference)
creating a batch file that calls rs.exe with the script file as a parameter
running the batch file on a schedule e.g. with Windows scheduler or SQL Server Agent
There is an example here of how to do this (to create Excel files but the principle is the same) http://skamie.wordpress.com/2010/08/11/using-rs-exe-to-render-ssrs-reports/
The solution for this problem is "Data Driven Subscription"
http://msdn.microsoft.com/en-us/library/ms169972(v=sql.105).aspx
http://www.kodyaz.com/reporting-services/create-data-driven-subscription-in-sql-server.aspx
the following link helped me alot but the query given in the link creates trouble- cast the datatype of the getdate and it will solve the problem
http://social.msdn.microsoft.com/Forums/en/sqlreportingservices/thread/0f075d9b-52f5-4a92-8570-43bbdaf2b2b1
I have had to do the same thing ( well almost )
I had to generate a weekly report to file and save it as REPORT-Week01.pdf, then REPORT-Week02.pdf etc.
The mechanism I used was to change the parameter column in the Schedule table via a scheduled job. This computed the required file name and simply replaced it. Then when the scheduled job runs, it writes to the file name setup when the schedule was created ( except that was changed at 1 minute past midnight to what I wanted it to be )
I have since implemeted another set of reports that write to a folder, whihc changes each month the the next months folder name ( currently writing all reports to a folder called 202103 ) tonight the job will run and the output folder will change to 202104 and the scheduled jobs will never need changing