<?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 Set analysis with Variable, expression fails using less than in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-Variable-expression-fails-using-less-than/m-p/1533767#M457244</link>
    <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I have an app where our customer required the functionality of dynamic current year-base year selection. I am solving this by the following method:&lt;/P&gt;&lt;P&gt;when user selects one or more years, I am choosing the latest from them, this is saved into a variable (vTárgyév).&lt;/P&gt;&lt;P&gt;This variable is the result of this expression:&lt;/P&gt;&lt;P&gt;SubField(GetFieldSelections([OrderYear],',',GetSelectedCount([OrderYear])),',',GetSelectedCount([OrderYear]))&lt;/P&gt;&lt;P&gt;I have a chart, where I have to summarize all the values before the chosen date. For this, I am using set analysis with a less than, that looks like this:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[Account] = {38506}, OrderYear ={"&amp;lt;=$($(vTárgyév)-1)"}&amp;gt;} Tartozik-[Követel])&lt;/P&gt;&lt;P&gt;The result is the sum of all the data, not just the values of the years before. For me this means that Qlik could not evaluate the "&lt;SPAN&gt;OrderYear ={"&amp;lt;=$($(vTárgyév)-1)"}" part.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have already tried turning vTárgyév into a numerical type, but it was not successful. With just using "=" it works.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I am just trying to get the current year, it works:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;[Account] = {38506}, OrderYear ={"=$(vTárgyév)"}&amp;gt;} Tartozik-[Követel])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What is also very interesting that after this, if I change the expression (-1):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;[Account] = {38506}, OrderYear ={"=$(vTárgyév)-1"}&amp;gt;} Tartozik-[Követel])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then it gives me the result of the expression with only&amp;nbsp;&lt;SPAN&gt;=$(vTárgyév), so there is some problem evaluating the whole expression.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Do you have any idea how can I fix this?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help is much appreciated,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tibor&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 04:41:13 GMT</pubDate>
    <dc:creator>tibor_sebok</dc:creator>
    <dc:date>2024-11-16T04:41:13Z</dc:date>
    <item>
      <title>Set analysis with Variable, expression fails using less than</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-Variable-expression-fails-using-less-than/m-p/1533767#M457244</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;I have an app where our customer required the functionality of dynamic current year-base year selection. I am solving this by the following method:&lt;/P&gt;&lt;P&gt;when user selects one or more years, I am choosing the latest from them, this is saved into a variable (vTárgyév).&lt;/P&gt;&lt;P&gt;This variable is the result of this expression:&lt;/P&gt;&lt;P&gt;SubField(GetFieldSelections([OrderYear],',',GetSelectedCount([OrderYear])),',',GetSelectedCount([OrderYear]))&lt;/P&gt;&lt;P&gt;I have a chart, where I have to summarize all the values before the chosen date. For this, I am using set analysis with a less than, that looks like this:&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[Account] = {38506}, OrderYear ={"&amp;lt;=$($(vTárgyév)-1)"}&amp;gt;} Tartozik-[Követel])&lt;/P&gt;&lt;P&gt;The result is the sum of all the data, not just the values of the years before. For me this means that Qlik could not evaluate the "&lt;SPAN&gt;OrderYear ={"&amp;lt;=$($(vTárgyév)-1)"}" part.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I have already tried turning vTárgyév into a numerical type, but it was not successful. With just using "=" it works.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If I am just trying to get the current year, it works:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;[Account] = {38506}, OrderYear ={"=$(vTárgyév)"}&amp;gt;} Tartozik-[Követel])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What is also very interesting that after this, if I change the expression (-1):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;sum({&amp;lt;[Account] = {38506}, OrderYear ={"=$(vTárgyév)-1"}&amp;gt;} Tartozik-[Követel])&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;then it gives me the result of the expression with only&amp;nbsp;&lt;SPAN&gt;=$(vTárgyév), so there is some problem evaluating the whole expression.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;Do you have any idea how can I fix this?&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Any help is much appreciated,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Tibor&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:41:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-Variable-expression-fails-using-less-than/m-p/1533767#M457244</guid>
      <dc:creator>tibor_sebok</dc:creator>
      <dc:date>2024-11-16T04:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with Variable, expression fails using less than</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-Variable-expression-fails-using-less-than/m-p/1533781#M457245</link>
      <description>Have you tested:&lt;BR /&gt;sum({&amp;lt;[Account] = {38506}, OrderYear ={"&amp;lt;=$(=$(vTárgyév)-1)"}&amp;gt;} Tartozik-[Követel])&lt;BR /&gt;</description>
      <pubDate>Wed, 23 Jan 2019 11:29:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-Variable-expression-fails-using-less-than/m-p/1533781#M457245</guid>
      <dc:creator>MindaugasBacius</dc:creator>
      <dc:date>2019-01-23T11:29:32Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with Variable, expression fails using less than</title>
      <link>https://community.qlik.com/t5/QlikView/Set-analysis-with-Variable-expression-fails-using-less-than/m-p/1533784#M457246</link>
      <description>&lt;P&gt;Hi Mindaugas,&lt;/P&gt;&lt;P&gt;yes, thank you! It worked, I've never tried putting the equal sign before the inner $ sign. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OrderYear ={"&amp;lt;=$(&lt;STRONG&gt;=&lt;/STRONG&gt;$(vTárgyév)-1)"}&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;, but this was the solution.&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tibor&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2019 11:33:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Set-analysis-with-Variable-expression-fails-using-less-than/m-p/1533784#M457246</guid>
      <dc:creator>tibor_sebok</dc:creator>
      <dc:date>2019-01-23T11:33:34Z</dc:date>
    </item>
  </channel>
</rss>

