<?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: Creating a custom formula in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137544#M912516</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is still treating the script as an error:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/127114_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Jun 2016 14:19:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-06-07T14:19:23Z</dc:date>
    <item>
      <title>Creating a custom formula</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137542#M912514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;I want to create a custom formula, and it is not working. I press CTRL M and enter my formula code below (which I got from another source, and it should be correct) then click OK.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;After that when I go to my script and enter this new function, and&amp;nbsp; it does not understand it. it is underlined as incorrect. How do I make the script recognize it?&amp;nbsp; What am I missing? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt;Function levenshtein( a, b )&lt;BR /&gt; Dim i,j,cost,d,min1,min2,min3&lt;BR /&gt; &lt;BR /&gt; ' Avoid calculations where there there are empty words&lt;BR /&gt; If Len( a ) = 0 Then levenshtein = Len( b &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Exit Function&lt;BR /&gt; If Len( b ) = 0 Then levenshtein = Len( a &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; Exit Function&lt;BR /&gt; &lt;BR /&gt; ' Array initialization&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; ReDim d( Len( a ), Len( b ) )&lt;BR /&gt; &lt;BR /&gt; For i = 0 To Len( a &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; d( i, 0 ) = i: Next&lt;BR /&gt; For j = 0 To Len( b &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; d( 0, j ) = j: Next&lt;BR /&gt; &lt;BR /&gt; ' Actual calculation&lt;BR /&gt; For i = 1 To Len( a )&lt;BR /&gt;&amp;nbsp; For j = 1 To Len( b )&lt;BR /&gt;&amp;nbsp; If Mid(a, i, 1) = Mid(b, j, 1) Then cost = 0 Else cost = 1 End If&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; ' Since min() function is not a part of VBScript, we'll &lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: maroon;"&gt;"emulate"&lt;/SPAN&gt;&lt;SPAN style="font-size: 9pt; font-family: 'Courier New'; color: black;"&gt; it below&lt;BR /&gt;&amp;nbsp; min1 = ( d( i - 1, j ) + 1 )&lt;BR /&gt;&amp;nbsp; min2 = ( d( i, j - 1 ) + 1 )&lt;BR /&gt;&amp;nbsp; min3 = ( d( i - 1, j - 1 ) + cost )&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; If min1 &amp;lt;= min2 And min1 &amp;lt;= min3 Then&lt;BR /&gt;&amp;nbsp; d( i, j ) = min1&lt;BR /&gt;&amp;nbsp; ElseIf min2 &amp;lt;= min1 And min2 &amp;lt;= min3 Then&lt;BR /&gt;&amp;nbsp; d( i, j ) = min2&lt;BR /&gt;&amp;nbsp; Else&lt;BR /&gt;&amp;nbsp; d( i, j ) = min3&lt;BR /&gt;&amp;nbsp; End If&lt;BR /&gt;&amp;nbsp; Next&lt;BR /&gt; Next&lt;BR /&gt; &lt;BR /&gt; levenshtein = d( Len( a ), Len( b ) )&lt;BR /&gt; End Function &lt;/SPAN&gt;&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/Creating-a-custom-formula/m-p/1137542#M912514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a custom formula</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137543#M912515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Seems to work for me if I use something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;LOAD&lt;/TD&gt;&lt;TD&gt;levenshtein('Stefan','Steffen') as Test&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Autogenerate 1;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 Jun 2016 22:00:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137543#M912515</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-06T22:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a custom formula</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137544#M912516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is still treating the script as an error:&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/127114_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 14:19:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137544#M912516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-07T14:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a custom formula</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137545#M912517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perhaps the problem is that I am using Personal Edition and one of my settings needs to change&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 14:26:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137545#M912517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-06-07T14:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a custom formula</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137546#M912518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to run the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 15:31:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137546#M912518</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2016-06-07T15:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a custom formula</title>
      <link>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137547#M912519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can you just click the 'Check' Button in the 'Edit Module' and try that?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Capture.JPG" class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/127133_Capture.JPG" style="height: 209px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jun 2016 15:48:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Creating-a-custom-formula/m-p/1137547#M912519</guid>
      <dc:creator>settu_periasamy</dc:creator>
      <dc:date>2016-06-07T15:48:24Z</dc:date>
    </item>
  </channel>
</rss>

