<?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: Halfway elegant solution for a formula required in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852578#M298925</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this&lt;/P&gt;&lt;P&gt;=pick(WildMatch(Field,'LVP','LVG','LV*P','LV*G')+1,&lt;/P&gt;&lt;P&gt;'fieldA',&lt;/P&gt;&lt;P&gt;6,&lt;/P&gt;&lt;P&gt;9,&lt;/P&gt;&lt;P&gt;0,&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 18 Jun 2015 12:15:05 GMT</pubDate>
    <dc:creator>Clever_Anjos</dc:creator>
    <dc:date>2015-06-18T12:15:05Z</dc:date>
    <item>
      <title>Halfway elegant solution for a formula required</title>
      <link>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852577#M298924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to implement the following logic:&lt;/P&gt;&lt;P&gt;I want to calculate a new field:&lt;/P&gt;&lt;P&gt;- If one field contains the exact string 'LVP', I want to return the nr. 6&lt;/P&gt;&lt;P&gt;- If it contains the exact string 'LVG', I want to return the nr. 9&lt;/P&gt;&lt;P&gt;- If it contains the string 'LV' in some place and maybe either 'P' or 'G' in some place, but also other letters, I want to&lt;BR /&gt;&amp;nbsp;&amp;nbsp; return the nr. 0&lt;/P&gt;&lt;P&gt;- In all other cases (e.g., if that field doesn't contain the letters 'LV' at all) i want to return the value of another field, say [fieldA}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could probably do that with an IF_function, but several nested IF_functions are not very elegant and not very easily manageable due to the large nr. of brackets to be closed at the very end or someplace in the middle of it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any more elegant solution to this?&lt;/P&gt;&lt;P&gt;I have thought about using PICK(MATCH()) or alt(), but haven't come to a satisfying solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 12:06:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852577#M298924</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-06-18T12:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Halfway elegant solution for a formula required</title>
      <link>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852578#M298925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please try this&lt;/P&gt;&lt;P&gt;=pick(WildMatch(Field,'LVP','LVG','LV*P','LV*G')+1,&lt;/P&gt;&lt;P&gt;'fieldA',&lt;/P&gt;&lt;P&gt;6,&lt;/P&gt;&lt;P&gt;9,&lt;/P&gt;&lt;P&gt;0,&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 12:15:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852578#M298925</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-06-18T12:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Halfway elegant solution for a formula required</title>
      <link>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852579#M298926</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;that is what I was thinking about. Is it certain that this will match top-down (from left to right, thus what has been matched to 'LVP' or 'LVG' won't be matched against any of the following values)?&lt;/P&gt;&lt;P&gt;This only lacks some way of dealing with all the items that do not match any of these (that do not contain the letters 'LV' at all)&lt;/P&gt;&lt;P&gt;Could this be wrapped inside an alt() function so that whatever isn't covered by this will return another value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 12:19:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852579#M298926</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-06-18T12:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Halfway elegant solution for a formula required</title>
      <link>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852580#M298927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Clever is taking care of the non-matching case by adding a 1 to the returned value of zero (in case of no match) from the WildMatch function.&lt;/P&gt;&lt;P&gt;Thus, the second argument of pick() (i.e. the expression to be used in case of '1') will be the default value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think there is just another case '0' missing at the end of the pick() argument list.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 12:27:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852580#M298927</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2015-06-18T12:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Halfway elegant solution for a formula required</title>
      <link>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852581#M298928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi swuehl,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is solved I think. I just realized I had to adapt one of my earlier formulas so it matches this one, but now I'm quite convinced that this part of the analysis is robust and stable and I can go on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 12:34:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852581#M298928</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-06-18T12:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: Halfway elegant solution for a formula required</title>
      <link>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852582#M298929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If does not match, &lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #edf8ca;"&gt;WildMatch returns 0, so 0+1 will evaluate to 1 and will be handled for the first clause.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #edf8ca;"&gt;Yes, you can wrap ALT(), but I don´t see a way it could be null&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 18 Jun 2015 13:35:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Halfway-elegant-solution-for-a-formula-required/m-p/852582#M298929</guid>
      <dc:creator>Clever_Anjos</dc:creator>
      <dc:date>2015-06-18T13:35:17Z</dc:date>
    </item>
  </channel>
</rss>

