Code does Not Read in FY 2025 Data

  • yrstruly wrote:

    Due to security i could not export data from the particular DB. I imported the very same flat files into my personal DB , with no issue. YOU could have done the same. I did all possible that i could, some of you simply refused to meet me half way.

    The objects already exist so you can import the files. If you want help, provide easily consumable scripts. I did not see the DDL for your metrics table, but it might look something like this.

    --CREATE SCHEMA PROD
    GO

    CREATE TABLE [Prod].[IMETAMetrics]
    ( [Fiscal year period] VARCHAR(100),
    [Calendar day]VARCHAR(100),
    [Month/Week] VARCHAR(100),
    [Day name]VARCHAR(100),
    [Metric Focus] VARCHAR(100),
    [Company]VARCHAR(100),
    [Material Code] VARCHAR(100),
    [Metric] VARCHAR(100),
    [Metric Value] VARCHAR(100),
    )

    GO
    INSERT INTO [Prod].[IMETAMetrics]
    ( [Fiscal year period], [Calendar day], [Month/Week], [Day name], [Metric Focus], [Company], [Material Code], [Metric], [Metric Value])
    VALUES
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1661','Distributor Stock','0'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1661','Emitter Stock','0'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1661','Field Stock','0'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1661','Plant Stock','247'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1661','Total Stock','247'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1661','Admin Stock','0'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1679','Distributor Stock','0'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1679','Emitter Stock','0'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1679','Field Stock','0'),
    ('001.2022','2021-07-01','27','Thursday','Weekly','AE10','1679','Plant Stock','170')

    SELECT *
    FROM [prod].[IMETAMetrics]

    DROP TABLE IF EXISTS [Prod].[IMETAMetrics]

    You can do most of the work for generating the insert values script by writing a query something like this.

    SELECT TOP (10) CONCAT('(''', [Fiscal year period], ''',''', [Calendar day],''',''', [Month/Week],''',''',
    [Day name],''',''', [Metric Focus],''',''', [Company],''',''', [Material Code],''',''', [Metric],''',''', [Metric Value], '''),')
    FROM [prod].[IMETAMetrics]
  • page 2?

  •  

     

     

     

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  •  

     

     

     

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • yrstruly wrote:

    Due to security i could not export data from the particular DB. I imported the very same flat files into my personal DB , with no issue. YOU could have done the same. I did all possible that i could, some of you simply refused to meet me half way.

    Why don't you get professional support? Ah, I see. You don't want to pay for people solving your problem. You expect a free of charge solution. Build a test enviroment and start debugging your problem by yourself. That's how learning works.

  • yrstruly wrote:

    Due to security i could not export data from the particular DB. I imported the very same flat files into my personal DB , with no issue. YOU could have done the same. I did all possible that i could, some of you simply refused to meet me half way.

    Why don't you get professional support? Ah, I see. You don't want to pay for people solving your problem. You expect a free of charge solution. Build a test enviroment and start debugging your problem by yourself. That's how learning works.

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply