Need to add one column to a table

  • Need to add one column to a table

    Posted by DSC Communities on August 29, 2019 at 4:43 pm
    • Michael Michniadowicz

      Member

      August 29, 2019 at 4:43 PM

      ?IĀ  need to add one column to an existing table.
      But the values come from the column in a different table.
      Add column from table below

      Add it to this table

      I don’t care about order, I can sort it later. Just need to add this particular column to the table.
      I know, it’s only two records, but this is just a test for larger datasets

      ——————————
      Michael Michniadowicz
      2102078768
      ——————————

    • Farhan Ahmed

      Member

      August 30, 2019 at 1:00 AM

      Do you have any joining condition between your tables?
      If yes, try use “MERGE Queries”Ā 

      If where is no joining keys between tables then create 1 column in Table with with Value = 1 ,and same column in Table 2 with Value =1
      Then use merge and join both tables, it will create Cross Join between your tables.

      ——————————
      Farhan Ahmed
      Senior Business Intelligence Consultant
      karachi
      3452523688
      ——————————
      ——————————————-

    • Peter Sladen

      Member

      August 30, 2019 at 5:05 AM

      Assuming the tables are appropriately related in your model then you can create a calculated column in your second table and say something like
      NewColumn = RELATED(GoalValue)
      The “appropriately related” bit is important. You might need to aggregate if second table is at higher grain, or you might get duplicate values if at lower grain.Ā 
      I find this a quicker and easier way of doing this kind of thing if it’s all I need from the other table, and I don’t want to simplify the model for any other reasons, otherwise Farhan’s suggestion of merging etc is probably the way forward.

      ——————————
      Peter Sladen
      Data Developer
      7220502304
      ——————————
      ——————————————-

    DSC Communities replied 6 years, 7 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

The discussion ‘Need to add one column to a table’ is closed to new replies.

Start of Discussion
0 of 0 replies June 2018
Now

Welcome to our new site!

Here you will find a wealth of information created for peopleĀ  that are on a mission to redefine business models with cloud techinologies, AI, automation, low code / no code applications, data, security & more to compete in the Acceleration Economy!