Forum Discussion
How to extract continuous string set from a column with multiple criteria
- 5 years ago
Anonymous - OK, I updated this with a Client Name output version and Project output version in 2 additional columns. I checked the matches, don't see anything obviously amiss. Solved?
PBIX is attached.
Greg_DecklerThanks for the file. I went throught the implementation and I somehow feel the logic is taking a different approach. Let me jot down the logic that I feel is a right approach. I am not sure if this is implementable with the current formula and functions in PBI.
Logic:
1. Pick value of first cell in Project table(Value to be found reference column). Start with searching for the first 3 characters of this cell in the Client Name (Find Within column). Return all the cells having these 3 characters in the Client Name appearing continuously and save it in a variable. Now add the 4th character and search for the continuous appearances in Client Name (Return values will decrease because of adding the 4th continuous character). Repeat adding characters until no matches are found.
Final value to be returned is the last variable value with the maximum continuous matches.
2. Now repeat the entire thing for value in the second cell of the Project Table.
This logic seems flawless and satisfies all criteria required. It also returns "Barcalays" or "Barcalays ".
Also doesnt match Tristate capital and Barcalays capital together because the search for character is always beginning from the first charater of the string which is Barcalays and not capital.
And yes the entire thing should be case insensitive.
Hope I was able to explain in an understandable way. The logic SEEMS easily implementable but the actual work is finding the right set of combinations of DAX to do so.
Anonymous - Correct me if I am wrong, but this would fail in the case of the sample data you provided, specifically:
LLP Ernst and Young trying to match with Ernst and Young
If I go with the first three trying to match, it will never return Ernst and Young because LLP does not equal "Ern".
Right?
- Anonymous5 years agoNot applicable
Greg_DecklerNo. The first 3 and above characters are to be taken from the reference table(column) and then search for a match in the client name column.
So 'Ern' will be matched with the client column to return the result for wherever the string 'ern' appears. So this way LLP 'Ern'st and Young will be mapped to 'Ern'.
I got the solution for this logic from a friend of mine using the PHP code. I am not sure of how to have this integrated to my Power BI. I have provided the link to my drive having the result file (.csv) and the code image for your reference. If you could help me with a way to implement this with Power BI that will fix the problem.
--------------------> Drive Link
Thank you for your time. Really appreciate it.