Forum Discussion
Anonymous
4 years agoNot applicable
Table.SelectRows in conjunction with if statement from another table
Hi, Trying to utilise an if statement within a Table.SelectRows and not having any joy, had a good look around and can't quite find the right thing.... So table Inventory(90+) lists all inve...
- 4 years ago
Assuming that your REP and CSR are values and not tables, and you want to use one conditional statement, you would do it like this...
= Table.SelectRows(#"Sorted Rows", each if CSR = null then [REP] = REP else [CSR] = CSR )Example:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WSlTSUUpRitWJVkoCslLhrDQwKxnISgezUuCsVCArQyk2FgA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [CSR = _t, REP = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"CSR", type text}, {"REP", type text}}), CSR = null, //"b", REP = "h", SelectRows = Table.SelectRows(#"Changed Type" , each if CSR = null then [REP] = REP else [CSR] = CSR ) in SelectRows
Anonymous
4 years agoNot applicable
non è assolutamente chiaro quello che cerchi.
sarebbe utile se caricassi delle tabelle di esempio.
Provo ad indovinare 🎰, comunque ...
se ti funziona Table.SelectRows(#"Sorted Rows", each ([CSR] = CSR))
allora prova con Table.SelectRows(#"Sorted Rows", each ([CSR] = CSR or [REP] = REP ))