Forum Discussion
Split Boolean Issue to display as only 'N' Flag value
- 3 years ago
Hi Dinvae
Power Query doesn't have case statement. You can use if ... then ... else ..., please refer to M Language Conditionals - PowerQuery M
In your case, if v_FLAG is a column, you can add a custom column with this M code:
if [v_FLAG] = "Y" then [v_FLAG] else if [v_FLAG] = "N" then "N" else [v_FLAG]or
if [v_FLAG] = "N" then "N" else [v_FLAG]If you are not using Power Query, you just need to modify your current code into
case when v_FLAG = 'Y' THEN v_FLAG when v_FLAG = 'N' THEN 'N' ELSE v_FLAG ENDBest Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi Dinvae
Power Query doesn't have case statement. You can use if ... then ... else ..., please refer to M Language Conditionals - PowerQuery M
In your case, if v_FLAG is a column, you can add a custom column with this M code:
if [v_FLAG] = "Y" then [v_FLAG] else if [v_FLAG] = "N" then "N" else [v_FLAG]
or
if [v_FLAG] = "N" then "N" else [v_FLAG]
If you are not using Power Query, you just need to modify your current code into
case
when v_FLAG = 'Y' THEN
v_FLAG
when v_FLAG = 'N' THEN
'N'
ELSE
v_FLAG END
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.