excel - Change a column in PowerQuery based on another column -


i try make in excel powerquery equal operation sql operation:

set columna = "max" columnc = "george"  

i know can create new column m expression

if columna = "max" "george" else "something"  

but don't create third column again , again.

any ideas how ?

you can chain if statements together, so

if [columna] = "max" "george" else if [columna] = "jane" "janet" else "something"

you can create record looks names , uses alternate name if exists. can done creating record in 1 query:

let     source = [max = "george", jane = "janet"] in     source 

let query called names. then, when add custom column, can use expression:

if record.hasfields(names, [columna]) record.field(names, [columna]) else "something"

hope helps.


Comments

Popular posts from this blog

c# - SharpSsh Command Execution -

python - Specify path of savefig with pylab or matplotlib -

How to run C# code using mono without Xamarin in Android? -