<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Stripping out the query string in a URL returning blank in Report Server</title>
    <link>https://community.fabric.microsoft.com/t5/Report-Server/Stripping-out-the-query-string-in-a-URL-returning-blank/m-p/4387234#M39484</link>
    <description>&lt;P&gt;Hello, I am trying to strip out everything including and after the ? from my url [page_location] to report on page usage, I am also stripping out my own website address to shorten the result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg in the below random website example url&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://ortc.com.au" target="_blank" rel="noopener"&gt;https://ortc.com.au&lt;/A&gt;&lt;/STRONG&gt;/products/logo-quarter-zip-charcoal&lt;STRONG&gt;?variant=41124690722934&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;all that would be left is&amp;nbsp;&lt;/P&gt;&lt;P&gt;/products/logo-quarter-zip-charcoal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My query, which is a result partly of these forums and our chatgpt friend, is below but keeps returning blanks for every result. If anyone has any ideas I would be extremely grateful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Page Path =&lt;/P&gt;&lt;P&gt;VAR &lt;SPAN&gt;Destringed_Page_Loc&lt;/SPAN&gt; =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;IF&lt;/SPAN&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;CONTAINSSTRING&lt;/SPAN&gt;(Query1[page_location], &lt;SPAN&gt;"?"&lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;LEFT&lt;/SPAN&gt;(Query1[page_location], &lt;SPAN&gt;SEARCH&lt;/SPAN&gt;(&lt;SPAN&gt;"?"&lt;/SPAN&gt;, Query1[page_location]) - &lt;SPAN&gt;1&lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Query1[page_location]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;RETURN &lt;SPAN&gt;SUBSTITUTE&lt;/SPAN&gt;(&lt;SPAN&gt;Destringed_Page_Loc&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A title="https://www.myurl.com.au%22" href="https://www.myurl.com.au%22" target="_blank" rel="noreferrer noopener"&gt;&lt;SPAN&gt;https://www.myurl.com.au"&lt;/SPAN&gt;&lt;/A&gt;, &lt;SPAN&gt;""&lt;/SPAN&gt;)&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jan 2025 03:50:12 GMT</pubDate>
    <dc:creator>L25</dc:creator>
    <dc:date>2025-01-30T03:50:12Z</dc:date>
    <item>
      <title>Stripping out the query string in a URL returning blank</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Stripping-out-the-query-string-in-a-URL-returning-blank/m-p/4387234#M39484</link>
      <description>&lt;P&gt;Hello, I am trying to strip out everything including and after the ? from my url [page_location] to report on page usage, I am also stripping out my own website address to shorten the result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg in the below random website example url&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://ortc.com.au" target="_blank" rel="noopener"&gt;https://ortc.com.au&lt;/A&gt;&lt;/STRONG&gt;/products/logo-quarter-zip-charcoal&lt;STRONG&gt;?variant=41124690722934&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;all that would be left is&amp;nbsp;&lt;/P&gt;&lt;P&gt;/products/logo-quarter-zip-charcoal&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My query, which is a result partly of these forums and our chatgpt friend, is below but keeps returning blanks for every result. If anyone has any ideas I would be extremely grateful!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Page Path =&lt;/P&gt;&lt;P&gt;VAR &lt;SPAN&gt;Destringed_Page_Loc&lt;/SPAN&gt; =&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;IF&lt;/SPAN&gt;(&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;CONTAINSSTRING&lt;/SPAN&gt;(Query1[page_location], &lt;SPAN&gt;"?"&lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;SPAN&gt;LEFT&lt;/SPAN&gt;(Query1[page_location], &lt;SPAN&gt;SEARCH&lt;/SPAN&gt;(&lt;SPAN&gt;"?"&lt;/SPAN&gt;, Query1[page_location]) - &lt;SPAN&gt;1&lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Query1[page_location]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;RETURN &lt;SPAN&gt;SUBSTITUTE&lt;/SPAN&gt;(&lt;SPAN&gt;Destringed_Page_Loc&lt;/SPAN&gt;, &lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A title="https://www.myurl.com.au%22" href="https://www.myurl.com.au%22" target="_blank" rel="noreferrer noopener"&gt;&lt;SPAN&gt;https://www.myurl.com.au"&lt;/SPAN&gt;&lt;/A&gt;, &lt;SPAN&gt;""&lt;/SPAN&gt;)&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 03:50:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Stripping-out-the-query-string-in-a-URL-returning-blank/m-p/4387234#M39484</guid>
      <dc:creator>L25</dc:creator>
      <dc:date>2025-01-30T03:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Stripping out the query string in a URL returning blank</title>
      <link>https://community.fabric.microsoft.com/t5/Report-Server/Stripping-out-the-query-string-in-a-URL-returning-blank/m-p/4387490#M39486</link>
      <description>&lt;P&gt;Try this revised DAX.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Extract Before Question = 
VAR _search = "?"  // Define the character to search for in the URL
VAR _replace = "|"  // Define a replacement character for the question mark
VAR _url_replace = SUBSTITUTE(MAX(Query1[page_location]), _search, _replace)  // Replace the "?" with "|" in the page location (URL)
VAR _url = _url_replace  // Assign the modified URL to a new variable
VAR _position = SEARCH(_replace, _url, 1, LEN(_url))  // Find the position of the replaced character in the URL
VAR _result = LEFT(_url, _position - 1)  // Extract the portion of the URL before the "|" character (excluding it)
VAR _debug = "URL: " &amp;amp; _url &amp;amp; " | Search Pos: " &amp;amp; _position // Debugging output to see the URL and position of the replacement character

RETURN
_result&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2025 06:37:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Report-Server/Stripping-out-the-query-string-in-a-URL-returning-blank/m-p/4387490#M39486</guid>
      <dc:creator>aduguid</dc:creator>
      <dc:date>2025-01-30T06:37:58Z</dc:date>
    </item>
  </channel>
</rss>

