<?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 Re: Comparing Two Strings in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparing-Two-Strings/m-p/1858986#M1216036</link>
    <description>&lt;P&gt;If you are building those strings in a chart, then you probably have the codes separated already and there might be other methods than comparing the resulting strings.&lt;BR /&gt;Can you please post some mock-up data and the relevant expressions of your chart to test solutions with?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;Marco&lt;/P&gt;</description>
    <pubDate>Sat, 13 Nov 2021 21:42:02 GMT</pubDate>
    <dc:creator>MarcoWedel</dc:creator>
    <dc:date>2021-11-13T21:42:02Z</dc:date>
    <item>
      <title>Comparing Two Strings</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-Two-Strings/m-p/1858366#M1215994</link>
      <description>&lt;P&gt;Hello group.&amp;nbsp; I'm wondering if there is a way to compare two comma delimited strings to see if any of the substrings in one string match any of the substrings in the other string.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mphekin12_1-1636657092888.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/66495i1703D21D5B2E1D80/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mphekin12_1-1636657092888.png" alt="mphekin12_1-1636657092888.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;So in the example above, I would like to create an expression that will return the value 'Existing' if any of the diagnosis codes in the string 'Diagnosis Codes in 2021' are found in the string 'Diagnosis Codes Before 2021'.&amp;nbsp; This would have to be done within a chart since I'm building out those strings within a chart using Set Analysis.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Nov 2021 19:04:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-Two-Strings/m-p/1858366#M1215994</guid>
      <dc:creator>mphekin12</dc:creator>
      <dc:date>2021-11-11T19:04:29Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Two Strings</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-Two-Strings/m-p/1858986#M1216036</link>
      <description>&lt;P&gt;If you are building those strings in a chart, then you probably have the codes separated already and there might be other methods than comparing the resulting strings.&lt;BR /&gt;Can you please post some mock-up data and the relevant expressions of your chart to test solutions with?&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;
&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Sat, 13 Nov 2021 21:42:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-Two-Strings/m-p/1858986#M1216036</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2021-11-13T21:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing Two Strings</title>
      <link>https://community.qlik.com/t5/QlikView/Comparing-Two-Strings/m-p/1859338#M1216057</link>
      <description>&lt;P&gt;Thanks for the reply Marco!&amp;nbsp; Here is what my data looks like in the underlying table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mphekin12_0-1636980941215.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/66651iC6846D2D90BBFBF0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mphekin12_0-1636980941215.png" alt="mphekin12_0-1636980941215.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Here is the table that I'm showing the end users after I summarize the data:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mphekin12_1-1636981166852.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/66652i9C632BFE8731C061/image-size/medium?v=v2&amp;amp;px=400" role="button" title="mphekin12_1-1636981166852.png" alt="mphekin12_1-1636981166852.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to figure out if the patient is a 'new' patient based on a year selected by the end user.&amp;nbsp; To be considered a new patient they either had to not have an encounter in the previous year or have a different diagnosis code in the current year.&amp;nbsp; As you can see in the data above, this patient should NOT be considered new.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the formula that I'm currently using (I know it isn't 100% correct due to the string comparison issue that I'm having):&lt;/P&gt;
&lt;P&gt;if((count({$&amp;lt;RC.Year={'&amp;lt;$(=max(RC.Year))'}&amp;gt;}DISTINCT PERSON_ID)=0 and count({$&amp;lt;RC.Year={'$(=max(RC.Year))'}&amp;gt;}DISTINCT PERSON_ID)&amp;gt;0)&lt;BR /&gt;or&lt;BR /&gt;(&lt;BR /&gt;(SubStringCount(Concat({$&amp;lt;RC.Year={'&amp;lt;$(=max(RC.Year))'}&amp;gt;}distinct DIAGNOSIS_CODE, ','),Concat({$&amp;lt;RC.Year={'$(=max(RC.Year))'}&amp;gt;}distinct DIAGNOSIS_CODE, ','))) &lt;BR /&gt;+ &lt;BR /&gt;(SubStringCount(Concat({$&amp;lt;RC.Year={'$(=max(RC.Year))'}&amp;gt;}distinct DIAGNOSIS_CODE, ','),Concat({$&amp;lt;RC.Year={'&amp;lt;$(=max(RC.Year))'}&amp;gt;}distinct DIAGNOSIS_CODE, ',')))&lt;BR /&gt;=0)&lt;BR /&gt;, &lt;BR /&gt;'New',&lt;BR /&gt;'Not New'&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 15 Nov 2021 13:01:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparing-Two-Strings/m-p/1859338#M1216057</guid>
      <dc:creator>mphekin12</dc:creator>
      <dc:date>2021-11-15T13:01:12Z</dc:date>
    </item>
  </channel>
</rss>

