Select value then must put in column.

  • Im trying to select leveling;

    I have table like this;

    FACC_WID FACC_BKEY FACC_CODE FACC_DESC FACC_CODE_DESC FACC_DESC_CODE FACC_H1_L5_CODE FACC_H1_L5_DESC FACC_H1_L5_CODE_DESC FACC_H1_L5_DESC_CODE FACC_H1_L4_CODE FACC_H1_L4_DESC FACC_H1_L4_CODE_DESC FACC_H1_L4_DESC_CODE FACC_H1_L3_CODE FACC_H1_L3_DESC FACC_H1_L3_CODE_DESC FACC_H1_L3_DESC_CODE FACC_H1_L2_CODE FACC_H1_L2_DESC FACC_H1_L2_CODE_DESC FACC_H1_L2_DESC_CODE FACC_H1_L1_CODE FACC_H1_L1_DESC FACC_H1_L1_CODE_DESC FACC_H1_L1_DESC_CODE FACC_TYPE_CODE FACC_TYPE_DESC FACC_TYPE_CODE_DESC FACC_TYPE_DESC_CODE FACC_CATEGORY_CODE FACC_CATEGORY_DESC FACC_CATEGORY_CODE_DESC FACC_CATEGORY_DESC_CODE FACC_ENTITIY_CODE FACC_ENTITY_DESC FACC_ENTITIY_CODE_DESC FACC_ENTITY_DESC_CODE INSERTED_DATE UPDATED_DATE INDICATOR_CURRENT START_DATE END_DATE

    ----------- ------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ---------------------------------------------------- ------------------------------------------------ ------------------------------------------------ -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- ----------------- ---------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------- ----------------------- ----------------- ----------------------- -----------------------

    38046 ABC_1 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 9 NULL 9 - (9) A8060010 Retouches A8060010 - Retouches Retouches (A8060010) ABC ABC nv ABC - ABC nv ABC nv (ABC) 2015-05-06 10:55:10.410 2015-05-06 10:55:10.410 1 2015-05-06 10:55:10.410 9999-12-31 00:00:00.000

    Now I need to make 5 levels like this

    1

    10

    100

    1001

    100100

    When column FACC_CODE have 1 char then its a level one so I put this in FACC_H1_L1_CODE..

    I this possible in (SSIS)?

  • GG_BI_GG (5/6/2015)


    Im trying to select leveling;

    I have table like this;

    FACC_WID FACC_BKEY FACC_CODE FACC_DESC FACC_CODE_DESC FACC_DESC_CODE FACC_H1_L5_CODE FACC_H1_L5_DESC FACC_H1_L5_CODE_DESC FACC_H1_L5_DESC_CODE FACC_H1_L4_CODE FACC_H1_L4_DESC FACC_H1_L4_CODE_DESC FACC_H1_L4_DESC_CODE FACC_H1_L3_CODE FACC_H1_L3_DESC FACC_H1_L3_CODE_DESC FACC_H1_L3_DESC_CODE FACC_H1_L2_CODE FACC_H1_L2_DESC FACC_H1_L2_CODE_DESC FACC_H1_L2_DESC_CODE FACC_H1_L1_CODE FACC_H1_L1_DESC FACC_H1_L1_CODE_DESC FACC_H1_L1_DESC_CODE FACC_TYPE_CODE FACC_TYPE_DESC FACC_TYPE_CODE_DESC FACC_TYPE_DESC_CODE FACC_CATEGORY_CODE FACC_CATEGORY_DESC FACC_CATEGORY_CODE_DESC FACC_CATEGORY_DESC_CODE FACC_ENTITIY_CODE FACC_ENTITY_DESC FACC_ENTITIY_CODE_DESC FACC_ENTITY_DESC_CODE INSERTED_DATE UPDATED_DATE INDICATOR_CURRENT START_DATE END_DATE

    ----------- ------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- -------------------- ---------------------------------------------------- ------------------------------------------------ ------------------------------------------------ -------------------- ------------------------------------------------------------ ----------------------------------------------------------------------------------- ----------------------------------------------------------------------------------- ----------------- ---------------------------------------- ----------------------------------------------- ----------------------------------------------- ----------------------- ----------------------- ----------------- ----------------------- -----------------------

    38046 ABC_1 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 1 eig.lollollol/lollo/lollol > 1Jaar 1 - eig.lollollol/lollo/lollol > 1Jaar eig.lollollol/lollo/lollol > 1Jaar (1) 9 NULL 9 - (9) A8060010 Retouches A8060010 - Retouches Retouches (A8060010) ABC ABC nv ABC - ABC nv ABC nv (ABC) 2015-05-06 10:55:10.410 2015-05-06 10:55:10.410 1 2015-05-06 10:55:10.410 9999-12-31 00:00:00.000

    Now I need to make 5 levels like this

    1

    10

    100

    1001

    100100

    When column FACC_CODE have 1 char then its a level one so I put this in FACC_H1_L1_CODE..

    I this possible in (SSIS)?

    It seems like life would be a lot simpler if you could normalize that table.

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 2 posts - 1 through 1 (of 1 total)

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