Hello, I have use case where I copy paste system rules to analzye into notepad.
I manually copy the ID's to help me run query's. This works ok for small rules but I want to automate this so I paste the rule into notepad and then refresh power query to automatically
1. extract the ID's from text string
2. concatenate the ID's into single text string with ',' delimiter
So far the best I have gotten is:
Load text to PQ
PQ will separate by space
Transpose to single column
filter ID's
add column with delimiter
transpose to single row and merge
output to excel as single text string with delimiter
however....
If I update the file with a new string it fails.
The reason message is that the number of columns have changed because the number of ID's extracted will be different each time. I can see that why that fails but now I can't work out a more efficient method.
Here is a mock up of file I use. ID is usually " 1-89GBH52 (Length can be from 8 - 10)
(PromotionID = 1-AFLLL34 or PromotionID = 1-5HGOAPAD or PromotionID = 1-DD98ADL or PromotionID = 1-1KLJH8O) sets procedural condition variable to true
What I am trying to achieve is that at any time I can just add new data to the text file (deleting old first) and refresh power query excel doc and it will output the string like this:
('1-AFLLL34','1-5HGOAPAD','1-DD98ADL','1-1KLJH8O')
I can then paste that into SQL query.
Cheers
Sam
Bookmarks