Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

How to create a 1 one column query based on another query without duplicate the query ?

Hi, 

 

I have a long query (#1) resulting in a multi column table.

I would like for different reasons to create a new query (#4) wich is the copy of column A of query #1 and to keep query #1 in my datamodel (so i dont want to delete others columns to get my 1 column query).

 

But all the solutions I have found (for example : right click on the column and choose "add as new query") results to execute a 2nd time the query #1 and to keep the column A as final step. But this also results to double the time needed to load my data model.

 

Is there anyway to copy paste my column A directly in a new query ?

 

 

To be more specific, I have 3 FACT tables that are 3 different queries but in all of them, I have a common column (column A).

In order to create a DIM query (#4) with masterdata, I want to get first all the distinct values of column A of query #1 #2 and #3.

Why I want to do that? because I just want to download from a SAAS cube the values corresponding to my columns A and not the 100000000000 values that are in it.

 

Thank you for your help 🙂

  • Make a new blank Query.

    Paste this (with your table name) in the advanced editor:

    let
        Source = #"TableX"[col1]
    in
        Source

     That will give a list (which you can convert to table from the interface)

  • Anonymous's avatar
    Anonymous
    5 years ago

     

     

    let
        Source = #"TableX"[[col1]]
    in
        Source

     

     

     

    using the double [[    and     ]] you get a column-table directly.

    But I don't think this solves the problem of performance

     

    Qualche miglioramento si può ottenere usando Table.Buffer  to wrapp the column-table

3 Replies

  • HotChilli's avatar
    HotChilli
    Community Champion

    Make a new blank Query.

    Paste this (with your table name) in the advanced editor:

    let
        Source = #"TableX"[col1]
    in
        Source

     That will give a list (which you can convert to table from the interface)

    • Anonymous's avatar
      Anonymous
      Not applicable

       

       

      let
          Source = #"TableX"[[col1]]
      in
          Source

       

       

       

      using the double [[    and     ]] you get a column-table directly.

      But I don't think this solves the problem of performance

       

      Qualche miglioramento si può ottenere usando Table.Buffer  to wrapp the column-table

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thank you guys

    I have also discovered the "reference" function which works also.