<?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: Set analysis with variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1823329#M67542</link>
    <description>&lt;P&gt;Oops, I lied a little.&amp;nbsp; That worked to get single transactions to show, but I had to add another = between ( and NUM to get it to sum right between dates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=SUM({$&amp;lt;TransactionDateNumber = {"&amp;lt;=$(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;NUM(vEndDate))"} &amp;gt;} FinancialMovement)&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jul 2021 14:23:18 GMT</pubDate>
    <dc:creator>DaniCalifornia</dc:creator>
    <dc:date>2021-07-20T14:23:18Z</dc:date>
    <item>
      <title>Set analysis with variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1822796#M67480</link>
      <description>&lt;P&gt;Help. I am just trying to get a variable into my set analysis. I know my variable is working because I have it writing to text fields and the table I'm trying to get this set analysis into. I have looked on the forums and my syntax seems to be right, but I cannot for the life of me to get any iteration of this to give me any financials whatsoever. I have transaction dates from 1988- July 2021. The end date is 5/31/2021 right now. It should sum everything prior to 5/31/2021, but I get nothing.&lt;/P&gt;&lt;P&gt;Here is my pared down set analysis. It's just this piece that does not work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;=SUM({$&amp;lt;TransactionDate = {"&amp;lt;=$(vEndDate)"} &amp;gt;} FinancialMovement)&lt;/P&gt;&lt;P&gt;I suspect it has something to do with formatting?? My TransactionDate I tag as date in the load script. My variable is populated from a drop down of date values. They are in the same yyy-MM-dd format, but my transaction date has time stamps after it. But that should not matter in a &amp;lt;= comparison.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone please tell me where I am going wrong? I'm out of ideas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;*Yes, I am using alternate states. I tried making it inherited though and no luck, and my variables pull into the table in the alternate state, so I don't believe that's the issue.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Snapshot to show - the drop downs are date selections, the text boxes are my variable outputs. I put them in the table as well. The set analysis is updating the financial movement column and I get nothing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 17 Jul 2021 00:38:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1822796#M67480</guid>
      <dc:creator>DaniCalifornia</dc:creator>
      <dc:date>2021-07-17T00:38:52Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1822859#M67486</link>
      <description>&lt;P&gt;Hi, I usually prefer to have dates that I will use in set analysis in number, so I can forget about dates format.&lt;/P&gt;&lt;P&gt;If you load the date as &lt;EM&gt;Num(Floor(&lt;/EM&gt;&lt;SPAN&gt;&lt;EM&gt;TransactionDate)) as&amp;nbsp;TransactionDateNum&lt;/EM&gt;, you will end with a date in number format with the time part removed and this expression should work:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=SUM({$&amp;lt;&lt;EM&gt;TransactionDateNum&lt;/EM&gt; = {"&amp;lt;=$(vEndDate)"} &amp;gt;} FinancialMovement)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Jul 2021 07:35:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1822859#M67486</guid>
      <dc:creator>rubenmarin</dc:creator>
      <dc:date>2021-07-18T07:35:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1823107#M67513</link>
      <description>&lt;P&gt;Thank you! I'm actually loading straight from SQL , not creating QVDs and all of that yet - because I'm still trying to get my model right. I added this to that table and tagged it as an integer:&lt;/P&gt;&lt;P&gt;,FLOOR(CAST([fct].[TransactionDate] AS [INT])) AS [TransactionDateNumber]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I wrapped my variable in a NUM() as well. Anywho, this works:&amp;nbsp;&lt;/P&gt;&lt;P&gt;=SUM({$&amp;lt;TransactionDateNumber = {"&amp;lt;=$(NUM(vEndDate))"} &amp;gt;} FinancialMovement)&lt;/P&gt;&lt;P&gt;Geez, data types!! Thank you for the suggestion. I've got everything there, just not matching on the stinking data types. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 19 Jul 2021 14:30:40 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1823107#M67513</guid>
      <dc:creator>DaniCalifornia</dc:creator>
      <dc:date>2021-07-19T14:30:40Z</dc:date>
    </item>
    <item>
      <title>Re: Set analysis with variable</title>
      <link>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1823329#M67542</link>
      <description>&lt;P&gt;Oops, I lied a little.&amp;nbsp; That worked to get single transactions to show, but I had to add another = between ( and NUM to get it to sum right between dates.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;=SUM({$&amp;lt;TransactionDateNumber = {"&amp;lt;=$(&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;=&lt;/STRONG&gt;&lt;/FONT&gt;NUM(vEndDate))"} &amp;gt;} FinancialMovement)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jul 2021 14:23:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Set-analysis-with-variable/m-p/1823329#M67542</guid>
      <dc:creator>DaniCalifornia</dc:creator>
      <dc:date>2021-07-20T14:23:18Z</dc:date>
    </item>
  </channel>
</rss>

