<?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 convert a string to number? in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/How-to-convert-a-string-to-number/m-p/1934422#M76973</link>
    <description>&lt;P&gt;your problem is that Financial Year is a string.&amp;nbsp; there are i suspect a number of ways to go about this.&lt;/P&gt;
&lt;P&gt;simplest is if your data will always be Year - Year and that it will always be consecutive: 2014-2015, 2015-2016, 2016-2017, etc.&amp;nbsp; you dont need NUM function,&amp;nbsp;2014-2015 string will be less than 2015-2016 string&lt;/P&gt;
&lt;P&gt;but to make sure your logic is scalable, create another field that you can use for your calculations like Year, where fiscal year 2014-2015 is considered Year 2014.&amp;nbsp; you dont have to show Year to your users all they see is Fiscal year so in your expression&lt;/P&gt;
&lt;P&gt;{&amp;lt;[Fiscal Year]=, Year={"&amp;lt;$(=subfield(concat(Year,','),',',1))"}&amp;gt;}&lt;/P&gt;
&lt;P&gt;this gets all the Fiscal years with year &amp;lt; the first selected year&lt;/P&gt;</description>
    <pubDate>Mon, 23 May 2022 18:30:00 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2022-05-23T18:30:00Z</dc:date>
    <item>
      <title>How to convert a string to number?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-convert-a-string-to-number/m-p/1934374#M76968</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I want to use set analysis to count the Number of Distinct Application Numbers where the financial year is lower than the selected "financial year" in the selection filter.&lt;/P&gt;
&lt;P&gt;I have used the below formula:&lt;/P&gt;
&lt;P&gt;Count(Distinct{&amp;lt;[Financial Year]={"&amp;lt;$(=Num(Subfield(GetFieldSelections([Financial Year]),', ', 1)))"}&amp;gt;}[Application Number]). However, this formula returns 0 as it isn't working as it should.&lt;/P&gt;
&lt;P&gt;Trying to pinpoint the issue,&amp;nbsp;Num(Subfield(GetFieldSelections([Financial Year]),', ', 1)) returns '-'&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Subfield(GetFieldSelections([Financial Year]),', ', 1)) returns the selection 2015-2016, so I figured it's an issue with the num function.&lt;/P&gt;
&lt;P&gt;How can I get the formula to work, by converting the string to a number? and&amp;nbsp;count the Number of Distinct Application Numbers where the financial year is lower than the selected "financial year" in the selection filter.&lt;/P&gt;
&lt;P&gt;Could anyone please help.&lt;/P&gt;
&lt;P&gt;Thanks in Advance.&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 16:01:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-convert-a-string-to-number/m-p/1934374#M76968</guid>
      <dc:creator>Zac_Tevin</dc:creator>
      <dc:date>2022-05-23T16:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert a string to number?</title>
      <link>https://community.qlik.com/t5/App-Development/How-to-convert-a-string-to-number/m-p/1934422#M76973</link>
      <description>&lt;P&gt;your problem is that Financial Year is a string.&amp;nbsp; there are i suspect a number of ways to go about this.&lt;/P&gt;
&lt;P&gt;simplest is if your data will always be Year - Year and that it will always be consecutive: 2014-2015, 2015-2016, 2016-2017, etc.&amp;nbsp; you dont need NUM function,&amp;nbsp;2014-2015 string will be less than 2015-2016 string&lt;/P&gt;
&lt;P&gt;but to make sure your logic is scalable, create another field that you can use for your calculations like Year, where fiscal year 2014-2015 is considered Year 2014.&amp;nbsp; you dont have to show Year to your users all they see is Fiscal year so in your expression&lt;/P&gt;
&lt;P&gt;{&amp;lt;[Fiscal Year]=, Year={"&amp;lt;$(=subfield(concat(Year,','),',',1))"}&amp;gt;}&lt;/P&gt;
&lt;P&gt;this gets all the Fiscal years with year &amp;lt; the first selected year&lt;/P&gt;</description>
      <pubDate>Mon, 23 May 2022 18:30:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/How-to-convert-a-string-to-number/m-p/1934422#M76973</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2022-05-23T18:30:00Z</dc:date>
    </item>
  </channel>
</rss>

