Forum Discussion
Anonymous
4 years agoNot applicable
Help with DW Schema queries
I'm working with multiple servers which have the same database, so I have to combine them. Sometimes they stop working, so I set parametes (ACT_Source...) to indicate if they are online or not. The ...
- 4 years ago
Use this (I can't see you passing Database here. You might need to replace Database with something like "Database" here depending upon your database name)
let fxConnection = (server as text) as table => Table.AddColumn( Sql.Database(server, Database){[Schema="DW",Item="DEClass"]}[Data], "Server", each server ), #"CombinedTables" = Table.Combine(List.RemoveNulls( { if ACT_SourceARA = 1 then fxConnection(ARA) else null, if ACT_SourceGOI = 1 then fxConnection(GOI) else null, if ACT_SourceIBI = 1 then fxConnection(IBI) else null }) ) in #"CombinedTables"
Vijay_A_Verma
4 years agoMost Valuable Professional
Use this (I can't see you passing Database here. You might need to replace Database with something like "Database" here depending upon your database name)
let
fxConnection =
(server as text) as table =>
Table.AddColumn(
Sql.Database(server, Database){[Schema="DW",Item="DEClass"]}[Data],
"Server",
each server
),
#"CombinedTables" =
Table.Combine(List.RemoveNulls(
{
if ACT_SourceARA = 1 then
fxConnection(ARA)
else
null,
if ACT_SourceGOI = 1 then
fxConnection(GOI)
else
null,
if ACT_SourceIBI = 1 then
fxConnection(IBI)
else
null
})
)
in
#"CombinedTables"
Anonymous
4 years agoNot applicable