Forum Discussion

achrafkasmi's avatar
achrafkasmi
Helper I
3 years ago

merge two tables on Directquery Mode

Hi, 

 

I have two tables in DirectQuery mode: V_demandeStockD and V_tranStockD.

 

I want to merge the two tables , and adding a columns on V_demandeStockD to have the ItemCode and Dscription from V_tranStockD for each expr1.

 

PS: there's a relation between Expr1 on V_demandeStockD and DocNum on V_transStockD.

 

Can you please help me add those columns in the table Tasks?

 

 

2 Replies

  • Table =
    UNION (
        SELECTCOLUMNS (
            V_demandeStockD,
            "ColumnName", [tablecolumn],
            .,
    .,
    .,
    "ColumnName", [tablecolumn]     ),     SELECTCOLUMNS (         table2,         "ColumnName", [tablecolumn],         
    .,
    .,
    .,
    "ColumnName", [tablecolumn]     ) )

    achrafkasmi  i hope this helpyou. 

  • hello, i work on a directquery MODE , i can't add a new table , i want to add the columns on V_demandeStockD to have the ItemCode and Dscription from V_tranStockD for each expr1.

     

    btw i tired lookup fonction but it's not working : 

    Mesure 21 = LOOKUPVALUE(V_transStockD[ItemCode],V_transStockD[Expr1],V_demandeStockD[DocNum])

     

    thanks