Skip to content

How to emulate COALESCE? #802

Answered by jqnatividad
tmtmtmtm asked this question in Q&A
Feb 24, 2023 · 3 comments · 11 replies
Discussion options

You must be logged in to vote

Hi @tmtmtmtm ,

I misunderstood your original query as I got confused because the join was giving the right result and didn't get that your question was more about manipulating the results using a coalesce-like function...

Anyways, with the new --remap option I just added to luau(#841), you can now do this:

qsv joinp --left --quiet id data.csv id names.csv | qsv luau map id,name --remap "{id,qsv_coalesce(name_right,name)}"
id,name
1,Artur A. Mosiyan
2,Eduard A. Aghabekyan
3,Aramais E. Aghabekyan
4,Eleonora V. Avanesyan

Replies: 3 comments 11 replies

Comment options

You must be logged in to vote
1 reply
@tmtmtmtm
Comment options

Comment options

You must be logged in to vote
5 replies
@tmtmtmtm
Comment options

@jqnatividad
Comment options

@tmtmtmtm
Comment options

@jqnatividad
Comment options

@jqnatividad
Comment options

Comment options

You must be logged in to vote
5 replies
@jqnatividad
Comment options

@tmtmtmtm
Comment options

@jqnatividad
Comment options

@tmtmtmtm
Comment options

@jqnatividad
Comment options

Answer selected by jqnatividad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants