<?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 do you make the yearname function return an int in qlikview in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129622#M764575</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume your issue arise from something different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Courier New'; font-size: 10.6667px;"&gt;Conversion failed when converting the varchar value '$(vCurrentYearRAM)' to data type int.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Courier New'; font-size: 10.6667px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here, the SQL should not 'see' $(vCurrentYearRAM) at all, a dollar sign expansion should have been replaced before sending the code to the SQL driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does your script look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Jul 2018 14:38:03 GMT</pubDate>
    <dc:creator>swuehl</dc:creator>
    <dc:date>2018-07-27T14:38:03Z</dc:date>
    <item>
      <title>How do you make the yearname function return an int in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129617#M764570</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have some SQL within Qlikview which when I try to run in SQL I get an error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8.0pt; font-family: 'Courier New';"&gt;Conversion failed when converting the varchar value '$(vCurrentYearRAM)' to data type int.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my variable is currently created like this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;let vCurrentYearRAM = right(YearName(today(),0,3),4);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I simply change it to the following it works:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;let vCurrentYearRAM = '2018';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I also tried the following and this does not work either:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;let vCurrentYearRAM = num(right(YearName(today(),0,3),4));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Any ideas?&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&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/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129617#M764570</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-11-25T16:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make the yearname function return an int in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129618#M764571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Nick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just use the function without any manipulation, like so:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vCurrentYearRAM = YearName(Num(Today()));&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;simpler option is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;let vCurrentYearRAM =Year(Today());&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That will return 2018 and when you expand it to the SQL query it should work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 17:21:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129618#M764571</guid>
      <dc:creator>felipedl</dc:creator>
      <dc:date>2018-07-26T17:21:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make the yearname function return an int in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129619#M764572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is the value you are getting from the variable? I am getting&amp;nbsp; "2019"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-1" src="https://community.qlik.com/legacyfs/online/208996_pastedImage_0.png" style="max-height: 900px; max-width: 1200px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 18:11:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129619#M764572</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-26T18:11:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make the yearname function return an int in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129620#M764573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try with Num# like Num(Num#(Right(YearName(today(), 0, 3),4)))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Jul 2018 18:38:31 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129620#M764573</guid>
      <dc:creator>neelamsaroha157</dc:creator>
      <dc:date>2018-07-26T18:38:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make the yearname function return an int in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129621#M764574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry 2018 was a bad example.&lt;/P&gt;&lt;P&gt;Our fiscal year runs from April, so today the fiscal year is 2018-2019 so would want it to display 2019 really&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2018 14:21:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129621#M764574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-07-27T14:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you make the yearname function return an int in qlikview</title>
      <link>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129622#M764575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume your issue arise from something different.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Courier New'; font-size: 10.6667px;"&gt;Conversion failed when converting the varchar value '$(vCurrentYearRAM)' to data type int.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Courier New'; font-size: 10.6667px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Here, the SQL should not 'see' $(vCurrentYearRAM) at all, a dollar sign expansion should have been replaced before sending the code to the SQL driver.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How does your script look like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Jul 2018 14:38:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/How-do-you-make-the-yearname-function-return-an-int-in-qlikview/m-p/129622#M764575</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2018-07-27T14:38:03Z</dc:date>
    </item>
  </channel>
</rss>

