<?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 Substring Count returning multiple strings with new Conditional Dimension Functionality in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413355#M1274287</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So recently I tried migrating from Macros to the new conditional Dimension functionality added in QV 11.&amp;nbsp; However, I have encountered one small problem that I have been unable to overcome without hardcoding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue is if you have two fields like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BENEFIT&lt;/P&gt;&lt;P&gt;SPORT_BENEFIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then using the conditional dimension it should usually be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BENEFIT:&lt;/P&gt;&lt;P&gt;substringcount(concat(%Dimension,'|'),'BENEFIT')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPORT_BENEFIT:&lt;/P&gt;&lt;P&gt;substringcount(concat(%Dimension,'|'),'SPORT_BENEFIT')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However as some of you may have already guessed, when you select SPORT_BENEFIT, you also get BENEFIT, as BENEFIT is a substring of SPORT_BENEFIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to use wildmatch but it fails on more than one selection due to the fact that is an exact string match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would think to use regular expressions but currently the sub strings in the field names sometimes fall at the beginning, middle or end of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only solution I came up with thus far is hard coding in for BENEFIT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=(SubStringCount(Concat(%Dimension, '|'), 'BENEFIT') = 2 and SubStringCount(Concat(%Dimension, '|'), 'SPORT_BENEFIT') = 1) or ((SubStringCount(Concat(%Dimension, '|'), 'BENEFIT') = 1 and SubStringCount(Concat(%Dimension, '|'), 'SPORT_BENEFIT') = 0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc... but this is going to be a pain in the future if lets say you wanted to add a SCHOOL_BENEFIT field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
    <dc:creator />
    <dc:date>2026-01-26T18:19:17Z</dc:date>
    <item>
      <title>Substring Count returning multiple strings with new Conditional Dimension Functionality</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413355#M1274287</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So recently I tried migrating from Macros to the new conditional Dimension functionality added in QV 11.&amp;nbsp; However, I have encountered one small problem that I have been unable to overcome without hardcoding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This issue is if you have two fields like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BENEFIT&lt;/P&gt;&lt;P&gt;SPORT_BENEFIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then using the conditional dimension it should usually be:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BENEFIT:&lt;/P&gt;&lt;P&gt;substringcount(concat(%Dimension,'|'),'BENEFIT')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPORT_BENEFIT:&lt;/P&gt;&lt;P&gt;substringcount(concat(%Dimension,'|'),'SPORT_BENEFIT')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However as some of you may have already guessed, when you select SPORT_BENEFIT, you also get BENEFIT, as BENEFIT is a substring of SPORT_BENEFIT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried to use wildmatch but it fails on more than one selection due to the fact that is an exact string match.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would think to use regular expressions but currently the sub strings in the field names sometimes fall at the beginning, middle or end of them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only solution I came up with thus far is hard coding in for BENEFIT:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=(SubStringCount(Concat(%Dimension, '|'), 'BENEFIT') = 2 and SubStringCount(Concat(%Dimension, '|'), 'SPORT_BENEFIT') = 1) or ((SubStringCount(Concat(%Dimension, '|'), 'BENEFIT') = 1 and SubStringCount(Concat(%Dimension, '|'), 'SPORT_BENEFIT') = 0))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;etc... but this is going to be a pain in the future if lets say you wanted to add a SCHOOL_BENEFIT field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Brandon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413355#M1274287</guid>
      <dc:creator />
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: Substring Count returning multiple strings with new Conditional Dimension Functionality</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413356#M1274290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're %dimension field is a data island, right? &lt;/P&gt;&lt;P&gt;Why not add a field to the this adhoc dimension table with more appropriate (i.e. appropriate for easy filtering) values, maybe just using numbers (2 to the power of n):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD * INLINE [&lt;/P&gt;&lt;P&gt;%Dimension, %DimNum&lt;/P&gt;&lt;P&gt;BENEFIT, 1&lt;/P&gt;&lt;P&gt;SPORT_BENEFIT, 2&lt;/P&gt;&lt;P&gt;SCHOOL_BENEFIT, 4&lt;/P&gt;&lt;P&gt;];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, as conditions for the three dimensions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum(%DimNum) bitand 1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum(%DimNum) bitand 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= sum(%DimNum) bitand 4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Nov 2012 20:55:33 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413356#M1274290</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-11-07T20:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Substring Count returning multiple strings with new Conditional Dimension Functionality</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413357#M1274292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah this should work fine -- thanks for the quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only issue I can kind of see is that I have 50 or so dimensions, and so the DimNum field is going to be pretty large by that point.&amp;nbsp; Was there any way to avoid the overinflation of these values that you can think of?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Nov 2012 17:36:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413357#M1274292</guid>
      <dc:creator />
      <dc:date>2012-11-08T17:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Substring Count returning multiple strings with new Conditional Dimension Functionality</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413358#M1274295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right, the proposed solution is maybe not applicable for very large value lists. My bottom line was intended to say:&lt;/P&gt;&lt;P&gt;Just use a connected field for filtering, that hold only values where no value is a sub set of another value in that field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using the bit pattern matching only adds a benefit on top, allowing your value matching to be more efficient.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I think you should be able to use also something like this (just having a continuous autonumbering of %DimNum) for you dimension conditional (which should also be really efficient):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({&amp;lt;%DimNum *= {1} &amp;gt;} %DimNum)&lt;/P&gt;&lt;P&gt;count({&amp;lt;%DimNum *= {2} &amp;gt;} %DimNum)&lt;/P&gt;&lt;P&gt;count({&amp;lt;%DimNum *= {3} &amp;gt;} %DimNum)&lt;/P&gt;&lt;P&gt;count({&amp;lt;%DimNum *= {4} &amp;gt;} %DimNum)&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps and works out,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;edit: Oh, maybe you don't need to use a second field if using this method at all.. Just use your field values of %Dimension in the set modifier of %Dimension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 15:21:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413358#M1274295</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-11-09T15:21:51Z</dc:date>
    </item>
    <item>
      <title>Re: Substring Count returning multiple strings with new Conditional Dimension Functionality</title>
      <link>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413359#M1274297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much!&amp;nbsp; Works perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2012 16:41:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Substring-Count-returning-multiple-strings-with-new-Conditional/m-p/413359#M1274297</guid>
      <dc:creator />
      <dc:date>2012-11-09T16:41:28Z</dc:date>
    </item>
  </channel>
</rss>

