Insert Function

Comments

6 comments

  • Avatar
    Malinda Jepsen

    Would it work to add a custom column and give each table a "name"?  The "name" would tell you which table the data came from.

    0
    Comment actions Permalink
  • Avatar
    Aaron Vickery

    Yes I think that will work but which function do I use to do that?

    0
    Comment actions Permalink
  • Avatar
    Malinda Jepsen

    I'm not sure which cube designer you're using. I'm using the "old" version. You just click the "+" sign to add a column, name it what you want and then click on the "Edit" link.  Inside the editor, just enter a string (or a number) to assign the literal value. You don't need a "SELECT" statement.

    0
    Comment actions Permalink
  • Avatar
    Malinda Jepsen

    This looks like the documentation for the web version of the cube designer: https://documentation.sisense.com/latest/managing-data/transforming-data/add-custom-field.htm

    0
    Comment actions Permalink
  • Avatar
    Gowtham Senthilkumar

    Hi Aaron, 

    You could just create a Custom Table - if you're on the Elasticube desktop tool, it is under Add Data > Add Custom Expression and then give a name to the table, which would then open up the SQL editor. If you're on the Web version of Elasticube, just tap on the "+ Custom" button on the right top which would straight away open up the SQL editor. 

    Use the code frame below to achieve your functionality: 

    SELECT *, 1 AS Table FROM <Table_1_Name>

    UNION ALL 

    SELECT *, 2 AS Table FROM <Table_2_Name>

    UNION ALL 

    SELECT *, 3 AS Table FROM <Table_3_Name>

    UNION ALL 

    SELECT *, 4 AS Table FROM <Table_4_Name>

    UNION ALL 

    SELECT *, 5 AS Table FROM <Table_5_Name>

     

    Replace "<Table_x_Name>" with the actual reference name of the table. Hope this works! 

    0
    Comment actions Permalink
  • Avatar
    Aaron Vickery

    great thanks

    0
    Comment actions Permalink

Please sign in to leave a comment.