Hi,
I have what I wanted as far as result but I think it may be better written,
So within a let statement I wanted to get the record field values if TRUE so below produces true / false column
Table.AddColumn(A, "Custom", each [ One = [Item] = "A" ,
Two = [Item] = "B",
Three = [Item] = "C" ,
Four = [Item] = "D" ])
This below gives me true and false that I want, but it means typing it all out each time I want to use it in a step
Table.AddColumn(A, "Custom", each [
One = if [Item] = "A" then 10 else "FALSE",
Two = if [Item] = "B" then 20 else "FALSE" ,
Three = if [Item] = "C" then 30 else "FALSE" ,
Four = if [Item] = "D" then 40 else "FALSE" ])
Since original post I have got a result but if any one can suggest a neater / shorter way of wriing it plase let me know, I would like to use the 'one , two, three, four ' form the original records, but not sure this is possible. I will attach copy;
This code i have is ;
let R =
[ One = [Item] = "A" ,
Two = [Item] = "B",
Three = [Item] = "C",
Four = [Item] = "D" ] ,
R2 =
[ One = if Record.Field( R, "One" ) then 10 else Record.Field(R, "One") ,
Two = if Record.Field( R,"Two" ) then 20 else Record.Field( R, "Two") ,
Three = if Record.Field( R, "Three") then 30 else Record.Field( R, "Three") ,
Four = if Record.Field( R,"Four" ) then 40 else Record.Field(R, "Four") ]
in R2
Richard.
Bookmarks