<?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: IntervalMatch with if statement and substring in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/IntervalMatch-with-if-statement-and-substring/m-p/1397532#M809469</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gregory,&lt;/P&gt;&lt;P&gt;Maybe something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HCPCSGrouping:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Num(KeepChar(FromHCPCS,'0123456789')) as FromHCPCS,&lt;/P&gt;&lt;P&gt;Num(KeepChar(ToHCPCS,'0123456789')) as ToHCPCS,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;[HCPCS Group]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\MISCELLANEOUS_DATA_FILES\CPT HCPC Groups.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [HCPCS Mapping]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then add line like this to your fact load statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Num(KeepChar(HCPCS,'0123456789)) as NumHCPCS,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Facts)&lt;/P&gt;&lt;P&gt;IntervalMatch (NumHCPCS) Load FromHCPCS,ToHCPCS Resident HCPCSGrouping;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;God luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 20 Oct 2017 08:24:18 GMT</pubDate>
    <dc:creator>effinty2112</dc:creator>
    <dc:date>2017-10-20T08:24:18Z</dc:date>
    <item>
      <title>IntervalMatch with if statement and substring</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-with-if-statement-and-substring/m-p/1397530#M809467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to group US medical Procedure Codes based on their ranges.&amp;nbsp; It was easily implemented for CPT codes as they are all 5 byte numeric.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it is more difficult with HCPCS codes because they begin with an alpha followed by 4 numeric bytes.&amp;nbsp; The ranges are unique per alpha.&amp;nbsp; I want to use IntervalMatch only when the first byte of the two compare codes are the same, and then perform the function on the last 4 bytes.&amp;nbsp; Example:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;R0070-R0076 should be grouped as Diagnostic Radiology Services.&amp;nbsp; I have an excel doc with the ranges set up with:&lt;/P&gt;&lt;P&gt;FromHCPCS, ToHCPCS, HCPCS Group&lt;/P&gt;&lt;P&gt;R0070, R0076, Diagnostic Radiology Services&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load Script below, where Service Cd is the field containing the CPT/HCPCS code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Directory;&lt;/P&gt;&lt;P&gt;HCPCSGrouping:&lt;/P&gt;&lt;P&gt;LOAD FromHCPCS, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ToHCPCS, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [HCPCS Group]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\MISCELLANEOUS_DATA_FILES\CPT HCPC Groups.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [HCPCS Mapping]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just don't know how to force IntervalMatch to only look at the last 4 bytes of my Service Cd, and also within an if statement based on the first byte, then return the original Service Cd to match to the original fact table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible with IntervalMatch, or is there another method I should be using?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Nov 2020 16:16:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-with-if-statement-and-substring/m-p/1397530#M809467</guid>
      <dc:creator>anothergreg</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch with if statement and substring</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-with-if-statement-and-substring/m-p/1397531#M809468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as there seems to be only a limited number of possible HCPCS codes one solution might be to expand the Groups to all possible code values e.g. like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="180271" alt="QlikCommunity_Thread_278575_Pic1.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/180271_QlikCommunity_Thread_278575_Pic1.JPG" style="height: auto; width: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="180273" alt="QlikCommunity_Thread_278575_Pic2.JPG" class="jive-image image-2" src="https://community.qlik.com/legacyfs/online/180273_QlikCommunity_Thread_278575_Pic2.JPG" style="height: 269px; width: 620px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15084466404678324 jive_text_macro" jivemacro_uid="_15084466404678324"&gt;
&lt;P&gt;tabHCPCSGrouping:&lt;/P&gt;
&lt;P&gt;LOAD Left(FromHCPCS,1)&amp;amp;Num(From+IterNo()-1,'0000') as HCPCS,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; FromHCPCS,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ToHCPCS,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; HCPCSGroup&lt;/P&gt;
&lt;P&gt;While From+IterNo()-1 &amp;lt;= To;&lt;/P&gt;
&lt;P&gt;LOAD @1 as FromHCPCS,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mid(@1,2) as From,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @3 as ToHCPCS,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Mid(@3,2) as To,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; @5 as HCPCSGroup&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;FROM [&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://www.findacode.com/code-set.php?set=HCPCS" rel="nofollow" target="_blank"&gt;https://www.findacode.com/code-set.php?set=HCPCS&lt;/A&gt;&lt;SPAN&gt;] (html, codepage is 1252, no labels, table is @5, filters(Remove(Row, Pos(Top, 1))));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;tabFacts:&lt;/P&gt;
&lt;P&gt;LOAD Chr(64+Ceil(Rand()*26))&amp;amp;Num(Rand()*10000,'0000') as HCPCS,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Ceil(Rand()*100) as SomeFact&lt;/P&gt;
&lt;P&gt;AutoGenerate 10000;&lt;/P&gt;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see also &lt;A href="https://community.qlik.com/qlik-blogpost/2940"&gt;Creating Reference Dates for Intervals&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Oct 2017 21:00:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-with-if-statement-and-substring/m-p/1397531#M809468</guid>
      <dc:creator>MarcoWedel</dc:creator>
      <dc:date>2017-10-19T21:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: IntervalMatch with if statement and substring</title>
      <link>https://community.qlik.com/t5/QlikView/IntervalMatch-with-if-statement-and-substring/m-p/1397532#M809469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gregory,&lt;/P&gt;&lt;P&gt;Maybe something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HCPCSGrouping:&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;Num(KeepChar(FromHCPCS,'0123456789')) as FromHCPCS,&lt;/P&gt;&lt;P&gt;Num(KeepChar(ToHCPCS,'0123456789')) as ToHCPCS,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;[HCPCS Group]&lt;/P&gt;&lt;P&gt;FROM&lt;/P&gt;&lt;P&gt;[..\MISCELLANEOUS_DATA_FILES\CPT HCPC Groups.xlsx]&lt;/P&gt;&lt;P&gt;(ooxml, embedded labels, table is [HCPCS Mapping]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then add line like this to your fact load statement:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Num(KeepChar(HCPCS,'0123456789)) as NumHCPCS,&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Left Join(Facts)&lt;/P&gt;&lt;P&gt;IntervalMatch (NumHCPCS) Load FromHCPCS,ToHCPCS Resident HCPCSGrouping;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;God luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Oct 2017 08:24:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/IntervalMatch-with-if-statement-and-substring/m-p/1397532#M809469</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2017-10-20T08:24:18Z</dc:date>
    </item>
  </channel>
</rss>

