Forum Discussion
coreych
3 years agoRegular Visitor
If then statement, invalid identifier
Hi all, I'm working with a database of baseball players. I need to match the contracts in my fantasy baseball league with the season projections I want for each player. The season projections datab...
jbwtp
3 years agoMemorable Member
Hi coreych,
You are not passing [Index] in this case, so when you are trying to use it PBI does not like it (cause it is not part of the context for the replacer funciton).
In your case, I think, it should be something like this (I am overloading the replacer function rather than the third parameter):
#"Replaced Value" = Table.ReplaceValue(#"Removed Columns", each [Index], null, (x,y,z)=> if y = "296" then "16942" else x, {"Player IDs.IDFANGRAPHS"})
coreych
3 years agoRegular Visitor
Thanks jbwtp,
That got rid of the error, but it doesn't appear to have done anything in my query. Player 296 still has the wrong fangraphs ID. It also did a weird thing to the query language overall after I ran it.
The last statement in the query before I put your language in was...
in # "added index"After I ran your language it changed to...
in
#"Added Index"
in
#"Pitcher Contracts with IDs