Forum Discussion

Anusha2020's avatar
Anusha2020
Frequent Visitor
3 years ago

Retrieve data from multiple files present in file path with the logic of loading data

Hi,

 

I need to Prices data should be added to added to an existing report which is based on Weekly/Monthly selection.

Source team is generating prices file on daily basis for all working days which has all forward prices data like below.

 

Sample data for files generation on daily basis.

 

Sample data available in the files:

 

As per above example all the forward prices will be available in the daily file. For eg: File i.e generated on 10-Apr-2023 is having prices from 10-Apr-2023 to till this year end. File i.e generated on 11-Apr-2023 is having prices from 11-Apr-2023.

 

Below is my requimrement

1. if I select Week14(9-Apr-2023 to 15-Apr-2023) pries for that week to be to be pulled from the previous week last working day file i.e 6-Apr-2023.(Note: Weeks starts from Sunday always)

2. if I select Apr-2023, pries for that month to be to be pulled from last working day of last month i.e 31-Mar-2023.

 

As like above based on weekly or monthly selection data to be automatically pulled from last working day of weekly or monthly file.

 

Kindly assist me on this.

 

 

3 Replies

    • Anusha2020's avatar
      Anusha2020
      Frequent Visitor

      Below is sample data for Retrieve data from multiple files present in file path with the logic of loading current week prices from last week last working day file generation.

      FileNameDatePrice
      Price_03-03-20233-Mar-23710
      Price_03-03-20234-Mar-23720
      Price_03-03-20235-Mar-23730
      Price_03-03-20236-Mar-23740
      Price_03-03-20237-Mar-23750
      Price_03-03-20238-Mar-23760
      Price_03-03-20239-Mar-23770
      Price_03-03-202310-Mar-23780
      Price_03-03-202311-Mar-23790
      Price_03-03-202312-Mar-23800
      Price_03-03-202313-Mar-23810
      Price_03-03-202314-Mar-23820
      Price_03-03-202315-Mar-23830
      Price_03-03-202316-Mar-23840
      Price_03-03-202317-Mar-23850
      Price_03-03-202318-Mar-23860
      Price_03-03-202319-Mar-23870
      Price_03-03-202320-Mar-23880
      Price_03-03-202321-Mar-23890
      Price_03-03-202322-Mar-23900
      Price_03-03-202323-Mar-23910
      Price_03-03-202324-Mar-23920
      Price_03-03-202325-Mar-23930
      Price_03-03-202326-Mar-23940
      Price_03-03-202327-Mar-23950
      Price_03-03-202328-Mar-23960
      Price_03-03-202329-Mar-23970
      Price_03-03-202330-Mar-23980
      Price_03-03-202331-Mar-23990
      Price_04-03-20234-Mar-231000
      Price_04-03-20235-Mar-231010
      Price_04-03-20236-Mar-231020
      Price_04-03-20237-Mar-231030
      Price_04-03-20238-Mar-231040
      Price_04-03-20239-Mar-231050
      Price_04-03-202310-Mar-231060
      Price_04-03-202311-Mar-231070
      Price_04-03-202312-Mar-231080
      Price_04-03-202313-Mar-231090
      Price_04-03-202314-Mar-231100
      Price_04-03-202315-Mar-231110
      Price_04-03-202316-Mar-231120
      Price_04-03-202317-Mar-231130
      Price_04-03-202318-Mar-231140
      Price_04-03-202319-Mar-231150
      Price_04-03-202320-Mar-231160
      Price_04-03-202321-Mar-231170
      Price_04-03-202322-Mar-231180
      Price_04-03-202323-Mar-231190
      Price_04-03-202324-Mar-231200
      Price_04-03-202325-Mar-231210
      Price_04-03-202326-Mar-231220
      Price_04-03-202327-Mar-231230
      Price_04-03-202328-Mar-231240
      Price_04-03-202329-Mar-231250
      Price_04-03-202330-Mar-231260
      Price_04-03-202331-Mar-231270
      Price_05-03-20235-Mar-231280
      Price_05-03-20236-Mar-231290
      Price_05-03-20237-Mar-231300
      Price_05-03-20238-Mar-231310
      Price_05-03-20239-Mar-231320
      Price_05-03-202310-Mar-231330
      Price_05-03-202311-Mar-231340
      Price_05-03-202312-Mar-231350
      Price_05-03-202313-Mar-231360
      Price_05-03-202314-Mar-231370
      Price_05-03-202315-Mar-231380
      Price_05-03-202316-Mar-231390
      Price_05-03-202317-Mar-231400
      Price_05-03-202318-Mar-231410
      Price_05-03-202319-Mar-231420
      Price_05-03-202320-Mar-231430
      Price_05-03-202321-Mar-231440
      Price_05-03-202322-Mar-231450
      Price_05-03-202323-Mar-231460
      Price_05-03-202324-Mar-231470
      Price_05-03-202325-Mar-231480
      Price_05-03-202326-Mar-231490
      Price_05-03-202327-Mar-231500
      Price_05-03-202328-Mar-231510
      Price_05-03-202329-Mar-231520
      Price_05-03-202330-Mar-231530
      Price_05-03-202331-Mar-231540

      Note: 1. Each file has forward prices till year end. I have given example till month end.

      2. Week always starts from Sunday & Ends with Monday

      Output for Week9:

      Output for Week9 should be: 
      5-Mar-23730
      6-Mar-23740
      7-Mar-23750
      8-Mar-23760
      9-Mar-23770
      10-Mar-23780
      11-Mar-23790

       

      In the above examle I have selected Week9(5-Mar-2023 to 11-Mar-2023). Prices for Week9 did fetch from Previous week(Week8) Last working day file(3-Mar-2023).

      • lbendlin's avatar
        lbendlin
        Icon for Super User rankSuper User

        Please define "working day" - is that Monday through Friday?

         

        Your sample data only applies to the weekly scenario, right?