<?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: How to subtract string from a string, subfield-wise in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291686#M497678</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan,&lt;/P&gt;&lt;P&gt;A bit lengthy way but can you check the attachement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Nov 2011 16:46:20 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-11-02T16:46:20Z</dc:date>
    <item>
      <title>How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291681#M497673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've got two strings:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let A = 'A, B, C, D, E';&lt;/P&gt;&lt;P&gt;Let B = 'C, E';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to get the difference / missing substrings when comparing B with A, i.e. result = 'A, B, D'&lt;/P&gt;&lt;P&gt;B is always is subgroup of A, delimiter is ', ' in this example but could be set as wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In real application, I build the strings dynamically in the frontend, the solution also needs to be one single expression (all expressions are within a chart object with dimensions and need to regard the dimensions, but first start with a simple example).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, anyone has a nice solution to this already?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 14:32:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291681#M497673</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-02T14:32:48Z</dc:date>
    </item>
    <item>
      <title>How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291682#M497674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This works for me: purgechar(vA,vB)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using 2 variables 'vA' = ABCDE and 'vB' = CE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The result is ABD&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All the best,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt - Visual Analytics Ltd&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 15:56:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291682#M497674</guid>
      <dc:creator>matt_crowther</dc:creator>
      <dc:date>2011-11-02T15:56:51Z</dc:date>
    </item>
    <item>
      <title>How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291683#M497675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan you can try something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replace(purgechar( A,purgechar(B,',')),',,',',')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 16:08:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291683#M497675</guid>
      <dc:creator />
      <dc:date>2011-11-02T16:08:02Z</dc:date>
    </item>
    <item>
      <title>How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291684#M497676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matt, thanks a lot for your quick answer, I was hoping for something simple like purgechar (which I haven't though of).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunetely, this will not work, I guess my above sample is a little simple.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hm, maybe consider this:&lt;/P&gt;&lt;P&gt;Let A = '100, 200, 300, 400, 500';&lt;/P&gt;&lt;P&gt;Let B = '200, 500';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=purgechar('100, 200, 300, 400, 500','200, 500')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will lead to 134, which is not what I want (ok, you might say,it will indicate the right numbers, like separate the digits and multiply by 100, but then look at something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=purgechar('122, 243, 321, 451, 521','243, 521')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;which results in empty string, while I expect 122, 321, 451&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume one needs to split at least one of the strings by its separator and then match / replace within the other. But I am open to any suggestions (still only in the frontend). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ah, probably a macro might do?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 16:09:56 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291684#M497676</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-02T16:09:56Z</dc:date>
    </item>
    <item>
      <title>How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291685#M497677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kiran, thanks,&amp;nbsp; too!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your solution has the same limitiations like Matt's regarding my hopefully now clarified requirements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think I can call a macro from within a chart expression context, so my last idea probably won't do neither.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 16:34:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291685#M497677</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-02T16:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291686#M497678</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stefan,&lt;/P&gt;&lt;P&gt;A bit lengthy way but can you check the attachement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kiran.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 16:46:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291686#M497678</guid>
      <dc:creator />
      <dc:date>2011-11-02T16:46:20Z</dc:date>
    </item>
    <item>
      <title>How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291687#M497679</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kiran, thank you again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think your solution is not much different from your above posted expression, except that you take care of comma separators in front or at the end of the resulting string, right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check my above post, I hope you will see that I am looking for something a bit different (I don't think just purging char from my string will do, since I want some substrings removed, while others with partly same characters should be preserved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But thanks again.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Nov 2011 16:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291687#M497679</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-02T16:57:38Z</dc:date>
    </item>
    <item>
      <title>How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291688#M497680</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Stefan, would you please share when you find a front-end solution for this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Nov 2011 20:59:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291688#M497680</guid>
      <dc:creator />
      <dc:date>2011-11-03T20:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291689#M497681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks everyone for your input!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I had a long night and think I managed now to get what I want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I finally got something like&lt;/P&gt;&lt;P&gt;=concat( if(wildmatch(vB,'*'&amp;amp;subfield(vA,', ',ValueLoop(1,nAnum,1))&amp;amp;'*'),NULL(),subfield(vA,', ',ValueLoop(1,nAnum,1)) ) ,', ')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I attach my qvw solution for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 Nov 2011 10:40:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291689#M497681</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2011-11-04T10:40:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291690#M497682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Stefan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have never used ValueLoop() before and found this post really useful - thanks!&amp;nbsp; Hope you don't mind the hijack, but I thought I'd offer a slightly different solution for those stumbling across this thread and who don't build the strings in the front end like you do...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I generally favour longer script execution times that reduce server load during user interactions so if I can possibly do something in the script I will do so.&amp;nbsp; If the strings and substrings are pre-known and not based on user-interaction then a combination of SubField() and Exists() will achieve the same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps someone - it was a useful exercise for me to pick apart your ValueLoop() solution and build a script alternative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Love this forum &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jason&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 13:54:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291690#M497682</guid>
      <dc:creator>Jason_Michaelides</dc:creator>
      <dc:date>2012-02-29T13:54:01Z</dc:date>
    </item>
    <item>
      <title>How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291691#M497683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jason,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree that doing such stuff in the script might be better - if the strings and substrings are preknown, in my settings they were not, as you already noticed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am a little fan of the valueloop() function, since it allows to create a loop in an aggregating expression, e.g. to rebuild the mathematical summing operation using an index (&lt;EM&gt;summation symbol&lt;/EM&gt; ∑ ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believe that is not the way the developers at QT were thinking of, but nevermind.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing your solution,&lt;/P&gt;&lt;P&gt;Stefan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 15:53:28 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291691#M497683</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-02-29T15:53:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291692#M497684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It helped me with another situation. Thanks for posting your solution.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 08:24:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291692#M497684</guid>
      <dc:creator />
      <dc:date>2015-08-27T08:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291693#M497685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just out of curiosity, could you outline in which context the above solution helped you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2015 08:59:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/291693#M497685</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-08-27T08:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract string from a string, subfield-wise</title>
      <link>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/2001041#M1221386</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;Stefan,&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you please attach Qlik Sense QVF example I need same logic to be implemented !&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Vikas&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 07:11:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-to-subtract-string-from-a-string-subfield-wise/m-p/2001041#M1221386</guid>
      <dc:creator>vikasmahajan</dc:creator>
      <dc:date>2022-11-07T07:11:27Z</dc:date>
    </item>
  </channel>
</rss>

