Forum Discussion

LinhNguyen's avatar
LinhNguyen
Icon for Helper II rankHelper II
6 years ago
Solved

Import data from SAP - How to choose latest date

Hi all,

 

I have a big table in SAP BW with a lot of columns. It times out whenever I try to load data into PowerBI. I'm trying to filter data to the latest report date (2020/03/14 in the example code below) to reduce the amount of data queried from SAP BW. Could you let me know if there's a way to make this date filter dynamic (get only the latest date).

 

I would also appreciate any suggestion on how to import large data with lots of columns from SAP. (I have tried filtering then appending together again but that way, I'll create a lot of tables)

 

= Cube.Transform(#"ZSD_O08/ZSD_O08_Q0001",
{
{Cube.ApplyParameter, "[!V000001]", {"[ZRPTDATE].[20200314]", "[ZRPTDATE].[20200314]"}},
{Cube.ApplyParameter, "[!V000005]", {{}}},
{Cube.ApplyParameter, "[0SALEORG]", {{"[0SALESORG].[1000]"}}},
{Cube.ApplyParameter, "[0S_PLANT]", {{"[0PLANT].[1000]"}}},
{Cube.AddAndExpandDimensionColumn, "[ZRPTTIME]", {"[ZRPTTIME].[LEVEL01]"}, {"Report Time.Report Time Level 01"}},
{Cube.AddAndExpandDimensionColumn, "[ZCUSTNZ1]", {"[ZCUSTNZ1].[LEVEL01]"}, {"Sales Manager Code.Sales Manager Code Level 01"}},
{Cube.AddAndExpandDimensionColumn, "[0SCHD_CATEG]", {"[0SCHD_CATEG].[LEVEL01]"}, {"Schedule Line Type.Schedule Line Type Level 01"}},
{Cube.AddMeasureColumn, "Original Order Quantity", "[Measures].[ZKF_ZSDO08_ORGOQ]"},
{Cube.AddMeasureColumn, "Unconfirmed Backlog Value in USD", "[Measures].[ZKF_ZSDO08_UNCONFBKLVU]"}
})

1 Reply