Forum Discussion
francoisl
6 years agoHelper II
splitting url data
HI all, I have seen a lot of answers for similar issue but nothing like I am expecting. I have a URL and I need to decipher data from that url. Here is the search part of a sample of the ...
- Anonymous6 years ago
Hi francoisl ,
You can try using following custom function code on 'query edit' side to look up specific text:let LookupValue=(sample as text,search as text) => let Source= List.Transform(Text.Split(sample,"&"), each [Key = Text.Split(_,"="){0}, Value = Text.Split(_,"="){1}]), Result= List.Transform(List.Select(Source, each Record.Field(_,"Key")=search), each Record.Field(_,"Value")){0} in Result in LookupValueNotice: If your result contains multiple results, please remove the bold part {0} to get full search result list.
Regards,
Xiaoxin Sheng
Anonymous
6 years agoNot applicable
Hi francoisl ,
You can try using following custom function code on 'query edit' side to look up specific text:
let
LookupValue=(sample as text,search as text) =>
let
Source= List.Transform(Text.Split(sample,"&"), each [Key = Text.Split(_,"="){0}, Value = Text.Split(_,"="){1}]),
Result= List.Transform(List.Select(Source, each Record.Field(_,"Key")=search), each Record.Field(_,"Value")){0}
in
Result
in
LookupValue
Notice: If your result contains multiple results, please remove the bold part {0} to get full search result list.
Regards,
Xiaoxin Sheng
francoisl
6 years agoHelper II
Hi,
Excellent solution, I think you need a different mindset to chop down text like this.
In fact, both solutions were good but M is better than DAX since I merged data from different sources.
Many thanks
Francois