<?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 SV:How do I apply the DUAL function either in a script or in an expression to give number value to text fields? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268850#M1203445</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mapping can be used too:&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;RatingMap:&lt;BR /&gt;MAPPING LOAD * INLINE [&lt;BR /&gt; A, B&lt;BR /&gt; small, 1&lt;BR /&gt; med, 5&lt;BR /&gt; big, 10];&lt;BR /&gt;LOAD&lt;BR /&gt; ...&lt;BR /&gt; dual(Rating, applymap('RatingMap',Rating,0)) as DualRating&lt;BR /&gt; ...&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Aug 2010 20:06:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2010-08-03T20:06:54Z</dc:date>
    <item>
      <title>How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268846#M1203441</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a field with ratings 'big,med,small'. I'd like to convert them to numbers without having to use a mapping table. Can someone show me the syntax using DUAL or other function?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 14:40:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268846#M1203441</guid>
      <dc:creator />
      <dc:date>2010-08-03T14:40:54Z</dc:date>
    </item>
    <item>
      <title>Re. :How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268847#M1203442</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You can use the match() or mixmatch() functions :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;match(rate,'small','med','big')&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 14:53:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268847#M1203442</guid>
      <dc:creator>martin59</dc:creator>
      <dc:date>2010-08-03T14:53:35Z</dc:date>
    </item>
    <item>
      <title>SV:How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268848#M1203443</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;..or use a classic if:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;if(RATING='big',dual(RATING,10),&lt;BR /&gt; if(RATING='med',dual(RATING,5),&lt;BR /&gt; if(RATING='small',dual(RATING,1),&lt;BR /&gt; dual(RATING,0)))) as DualRating&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt; &lt;P&gt;This simple code makes a rating big get the dual value 10, med get 5, small get 1, and if anything else, it gets 0.&lt;/P&gt;&lt;P&gt;Cheers!&lt;/P&gt;&lt;P&gt;(closing parenthesis now also in code, thanks Scott ;P)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 16:34:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268848#M1203443</guid>
      <dc:creator />
      <dc:date>2010-08-03T16:34:39Z</dc:date>
    </item>
    <item>
      <title>SV:How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268849#M1203444</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just don't forget to close all those parentheses!&lt;/P&gt;&lt;P&gt;Scott&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 18:52:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268849#M1203444</guid>
      <dc:creator>smoon63</dc:creator>
      <dc:date>2010-08-03T18:52:15Z</dc:date>
    </item>
    <item>
      <title>SV:How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268850#M1203445</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Mapping can be used too:&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE style="overflow-x: scroll;"&gt;&lt;PRE style="margin: 0px;"&gt;&lt;BR /&gt;RatingMap:&lt;BR /&gt;MAPPING LOAD * INLINE [&lt;BR /&gt; A, B&lt;BR /&gt; small, 1&lt;BR /&gt; med, 5&lt;BR /&gt; big, 10];&lt;BR /&gt;LOAD&lt;BR /&gt; ...&lt;BR /&gt; dual(Rating, applymap('RatingMap',Rating,0)) as DualRating&lt;BR /&gt; ...&lt;BR /&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 20:06:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268850#M1203445</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-08-03T20:06:54Z</dc:date>
    </item>
    <item>
      <title>Re. :How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268851#M1203446</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to expand a bit on Martin's solution, which is probably what I'd personally use for a list this small, the dual() itself would then be this:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;dual(rating,match(rating,'small','med','big'))&lt;/P&gt;&lt;P&gt;which assigns a value of 1 to small, 2 to med, and 3 to big. You could use that directly in a chart as written, but it would probably be better to put it in your script:&lt;/P&gt;&lt;P style="padding-left:30px;"&gt;dual(rating,match(rating,'small','med','big')) as rating&lt;/P&gt;&lt;P&gt;I'd use Jakob's nested-IF solution if I indeed needed numbers like 10, 5 and 1 instead of 3, 2 and 1, at least for this short of a list.&lt;/P&gt;&lt;P&gt;I'd probably use Michael's mapping solution if I had a longer list. Not sure how much longer. Maybe 10 items or more?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Aug 2010 20:16:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268851#M1203446</guid>
      <dc:creator>johnw</dc:creator>
      <dc:date>2010-08-03T20:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Re. :How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268852#M1203447</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John, &lt;/P&gt;&lt;P&gt;How would you use this to ensure date fields are sorted in Date order, not in alpha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.&amp;nbsp; Month name Jan, Feb, Mar, Apr etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we ensure that these will sort based on Month Number.&amp;nbsp; Is it as simple as loading the dates in ascending order and using sort on LOAD ORDER or will the dual command work better for this using a mappingload of 1 thru 12 and the dual command?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 18:19:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268852#M1203447</guid>
      <dc:creator />
      <dc:date>2012-08-16T18:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Re. :How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268853#M1203448</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John, &lt;/P&gt;&lt;P&gt;How would you use this to ensure date fields are sorted in Date order, not in alpha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.&amp;nbsp; Month name Jan, Feb, Mar, Apr etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we ensure that these will sort based on Month Number.&amp;nbsp; Is it as simple as loading the dates in ascending order and using sort on LOAD ORDER or will the dual command work better for this using a mappingload of 1 thru 12 and the dual command?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 18:20:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268853#M1203448</guid>
      <dc:creator />
      <dc:date>2012-08-16T18:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I apply the DUAL function either in a script or in an expression to give number value to text fields?</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268854#M1203449</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John, &lt;/P&gt;&lt;P&gt;How would you use this to ensure date fields are sorted in Date order, not in alpha&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e.&amp;nbsp; Month name Jan, Feb, Mar, Apr etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can we ensure that these will sort based on Month Number.&amp;nbsp; Is it as simple as loading the dates in ascending order and using sort on LOAD ORDER or will the dual command work better for this using a mappingload of 1 thru 12 and the dual command?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2012 18:20:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-I-apply-the-DUAL-function-either-in-a-script-or-in-an/m-p/268854#M1203449</guid>
      <dc:creator />
      <dc:date>2012-08-16T18:20:08Z</dc:date>
    </item>
  </channel>
</rss>

