Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
case
when position('jdbc:snowflake' in jdbc_url) > 0 then split_part(split_part (jdbc_url, '/', 3), ':',1)
when position('jdbc:oracle' in jdbc_url) > 0 then split_part(split_part (jdbc_url, '@', 2), ':',1)
when position('jdbc:sqlserver' in jdbc_url) > 0 then split_part(split_part (jdbc_url, '/', 3), ':',1)
when position('jdbc:db2' in jdbc_url) > 0 then split_part(split_part (jdbc_url, '/', 3), ':',1)
when position('jdbc:teradata' in jdbc_url) > 0 then split_part(split_part (jdbc_url, '/', 3), ':',1)
when position('jdbc:postgresql' in jdbc_url) > 0 then split_part(split_part (jdbc_url, '/', 3), ':',1)
when position('jdbc:spark' in jdbc_url) > 0 then split_part(split_part (jdbc_url, '/', 3), ':',1)
when position('jdbc:mongodb' in jdbc_url) > 0 then split_part(split_part (jdbc_url, '=', 2), ';',1)
else jdbc_url
end as JdbcHost
Eg: jdbc:oracle:thin:@abcdefg.ddshdss.org:1111/dsdsds - need to split the particular text (abcdefg.ddshdss.org)
jdbc:sqlserver://asasasasas.dsads2000.org:34343; - (asasasasas.dsads2000.org)
Solved! Go to Solution.
@Anonymous , Check this power query solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Ncs5DoAgFEXRrRhqAzhU38Z9GArg4xQikWdcv0P0nvoOg1jZeUrZ+hjomJeNeus8h3GSzJgZkClPVN0pxqMQpvw27BEhnyGTUhY/ybCMWmv9rk1764QxFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","@","//",Replacer.ReplaceText,{"Column1"}),
#"Extracted Text Between Delimiters" = Table.TransformColumns(#"Replaced Value", {{"Column1", each Text.BetweenDelimiters(_, "//", ":"), type text}})
in
#"Extracted Text Between Delimiters"
Add this code as power query/transform data in blank query and check
Hi @Anonymous
Compared to using DAX, it is easier to use the split function in Power Query. The method provided by @amitchandak is feasible , and I follow his method to extract the data you want .
Best Regard
Community Support Team _ Ailsa Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , you have to create something like that
new column =
var _1 =mid([jdbc_url],search("/", [jdbc_url],,0 ) ,3)
Switch(True() ,
search("jdbc:snowflake", [jdbc_url],,0 ) >0 , mid(_1,search(":", _1,,0 ) ,1)
// Add other columns
)
@amitchandak, This above DAX is not working for me. jdbc_url is a column not a hard corded value or measure. Could u please help the exact dax fo this solution?
@Anonymous , Check this power query solution.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("Ncs5DoAgFEXRrRhqAzhU38Z9GArg4xQikWdcv0P0nvoOg1jZeUrZ+hjomJeNeus8h3GSzJgZkClPVN0pxqMQpvw27BEhnyGTUhY/ybCMWmv9rk1764QxFw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}}),
#"Replaced Value" = Table.ReplaceValue(#"Changed Type","@","//",Replacer.ReplaceText,{"Column1"}),
#"Extracted Text Between Delimiters" = Table.TransformColumns(#"Replaced Value", {{"Column1", each Text.BetweenDelimiters(_, "//", ":"), type text}})
in
#"Extracted Text Between Delimiters"
Add this code as power query/transform data in blank query and check
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
25 | |
18 | |
16 | |
16 | |
16 |
User | Count |
---|---|
26 | |
26 | |
19 | |
15 | |
14 |