Forum Discussion
Data cleanup and Grouping
- Anonymous4 years ago
Hi Valnus ,
Yes, you need to run through the data set and defind the columns for all different strings you want to extract and group in you code.
Just like this code. I create a calculated column to run through the dataset and defind the [complaint] column for all different strings I want and put them into groups like Cough/Check Up / Stomach and so on.
Group = SWITCH ( TRUE (), CONTAINSSTRING ( 'Table'[complaint], "Cough" ), "Cough", CONTAINSSTRING ( 'Table'[complaint], "Check Up" ), "Check Up", CONTAINSSTRING ( 'Table'[complaint], "Stomach" ), "Stomach", CONTAINSSTRING ( 'Table'[complaint], "Backache" ), "Backache", "None" )Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi
I will give this a try.
Do I assume correctly that i need to run through the data set and define the colums for each diffrent string we want to extract and group ?
Hi Valnus ,
Yes, you need to run through the data set and defind the columns for all different strings you want to extract and group in you code.
Just like this code. I create a calculated column to run through the dataset and defind the [complaint] column for all different strings I want and put them into groups like Cough/Check Up / Stomach and so on.
Group =
SWITCH (
TRUE (),
CONTAINSSTRING ( 'Table'[complaint], "Cough" ), "Cough",
CONTAINSSTRING ( 'Table'[complaint], "Check Up" ), "Check Up",
CONTAINSSTRING ( 'Table'[complaint], "Stomach" ), "Stomach",
CONTAINSSTRING ( 'Table'[complaint], "Backache" ), "Backache",
"None"
)
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.