<?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: Using nested functions within Set Analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412175#M488311</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rva_heldendaten, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did paste your formula into the expression and it seems to work!! Ill have to recheck the numbers as I have a lot of data. (Atleast it produces an output, much better than mine..) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately though, I am bamboozeled by the logic of the formula. I would be grateful if you could explain it to me so that I can design similar ones in the future. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some of my questions: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I assume yearstart() gives the start date of the current year. I.e if the user selects 18/12/2012, yearstart() returns 01/01/2012 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I am not sure what the only() funtiuon does, but I assume in this case that it returns 18/12/2012 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. What really confuses me, is the $ sign at the start of the formulas. Does that not reduce the formulas to work only on the current selection or rows of data? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me explain how I understand the logic, and if you can correct my flaw, it would be great. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume my universal data set (which captures sales on a weekly basis) is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SelectDate&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer Sales &lt;/P&gt;&lt;P&gt;04/12/2012 A 100 &lt;/P&gt;&lt;P&gt;04/12/2012 B 200 &lt;/P&gt;&lt;P&gt;04/12/2012 C 300 &lt;/P&gt;&lt;P&gt;11/12/2012 A 400 &lt;/P&gt;&lt;P&gt;11/12/2012 B 500 &lt;/P&gt;&lt;P&gt;11/12/2012 C 600 &lt;/P&gt;&lt;P&gt;18/12/2012 A 700 &lt;/P&gt;&lt;P&gt;18/12/2012 B 800 &lt;/P&gt;&lt;P&gt;18/12/2012 C 900 &lt;/P&gt;&lt;P&gt;25/12/2012 A 1000 &lt;/P&gt;&lt;P&gt;25/12/2012 B 1100 &lt;/P&gt;&lt;P&gt;25/12/2012 C 1200 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, if the user selects 18/12/2012 in the selection, my understanding is that yearstart() returns 1/1/2012 and only() returns 18/12/2012. BUT what confuses is me is that if the formula begins with a $, i.e "=sum({$&amp;lt;SelectDate", Wont the data set that the formulaes then work on be reduced to just the current selection, i.e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;18/12/2012 A 700&lt;/P&gt;&lt;P&gt;18/12/2012 B 800&lt;/P&gt;&lt;P&gt;18/12/2012 C 900&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which will then return sales of 2400 instead of the correct answer of 4500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be great if you could point out the flaw in my logic!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jan 2013 09:56:39 GMT</pubDate>
    <dc:creator />
    <dc:date>2013-01-11T09:56:39Z</dc:date>
    <item>
      <title>Using nested functions within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412173#M488309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This might seem simple, but I am quite new to Qlikview.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have sales data loaded into qlikview on a weekly basis. I.e, every week data is loaded with sales of various clients for that week. I currently have a selection box that lets users select a date and a table that shows sales (and some other information) for each client.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like to now display a Year to date number for each client, based on the current selection. Assuming the user clicks on 15/12/2012, then I want a sum of all weeks of sales upto that date. That is, sum ALL weeks (or rows) that are LESSER THAN OR EQUAL TO the currently selected date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My reasoning was I would need to use a set analysis that uses current selection AND a date comparing function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My date field that the user selects is called SelectDate and my Sales field is called Sales. I only have 2012 data loaded.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I came up, and it is miserably failing!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ( {1 &amp;lt;SelectDate&lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;&amp;lt;=&lt;/STRONG&gt;&lt;/SPAN&gt;{GetFieldSelections(SelectDate)}&amp;gt; } Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Im sure i am tripping up with the bit in red i,e using &amp;lt;= for lesser than or equal to. But even if i remove the "&amp;lt;", my expression does not work.i.e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sum ( {1 &amp;lt;SelectDate={GetFieldSelections(SelectDate)}&amp;gt; } Sales).. Which I assumed should simply sum all data based on current selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help will be much appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 16:39:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412173#M488309</guid>
      <dc:creator />
      <dc:date>2013-01-10T16:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using nested functions within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412174#M488310</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Quite some ways to achive this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=sum({$&amp;lt;SelectDate={"&amp;gt;=$(=yearstart(SelectDate))&amp;lt;=$(=only(SelectDate))"}&amp;gt;} Sales)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$... respect the current user selection&lt;/P&gt;&lt;P&gt;then overwrite SelectDate with a dynamic expression similar to:&lt;/P&gt;&lt;P&gt; SelectDate={"&amp;gt;=01/01/2003&amp;lt;=10/01/2013"}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This tool can help with Set Analysis: &lt;A class="loading" href="http://tools.qlikblog.at/SetAnalysisWizard/" title="http://tools.qlikblog.at/SetAnalysisWizard/"&gt;http://tools.qlikblog.at/SetAnalysisWizard/&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2013 17:12:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412174#M488310</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-10T17:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Using nested functions within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412175#M488311</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rva_heldendaten, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I did paste your formula into the expression and it seems to work!! Ill have to recheck the numbers as I have a lot of data. (Atleast it produces an output, much better than mine..) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately though, I am bamboozeled by the logic of the formula. I would be grateful if you could explain it to me so that I can design similar ones in the future. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some of my questions: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. I assume yearstart() gives the start date of the current year. I.e if the user selects 18/12/2012, yearstart() returns 01/01/2012 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I am not sure what the only() funtiuon does, but I assume in this case that it returns 18/12/2012 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. What really confuses me, is the $ sign at the start of the formulas. Does that not reduce the formulas to work only on the current selection or rows of data? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me explain how I understand the logic, and if you can correct my flaw, it would be great. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let's assume my universal data set (which captures sales on a weekly basis) is: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SelectDate&amp;nbsp;&amp;nbsp;&amp;nbsp; Customer Sales &lt;/P&gt;&lt;P&gt;04/12/2012 A 100 &lt;/P&gt;&lt;P&gt;04/12/2012 B 200 &lt;/P&gt;&lt;P&gt;04/12/2012 C 300 &lt;/P&gt;&lt;P&gt;11/12/2012 A 400 &lt;/P&gt;&lt;P&gt;11/12/2012 B 500 &lt;/P&gt;&lt;P&gt;11/12/2012 C 600 &lt;/P&gt;&lt;P&gt;18/12/2012 A 700 &lt;/P&gt;&lt;P&gt;18/12/2012 B 800 &lt;/P&gt;&lt;P&gt;18/12/2012 C 900 &lt;/P&gt;&lt;P&gt;25/12/2012 A 1000 &lt;/P&gt;&lt;P&gt;25/12/2012 B 1100 &lt;/P&gt;&lt;P&gt;25/12/2012 C 1200 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, if the user selects 18/12/2012 in the selection, my understanding is that yearstart() returns 1/1/2012 and only() returns 18/12/2012. BUT what confuses is me is that if the formula begins with a $, i.e "=sum({$&amp;lt;SelectDate", Wont the data set that the formulaes then work on be reduced to just the current selection, i.e&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;18/12/2012 A 700&lt;/P&gt;&lt;P&gt;18/12/2012 B 800&lt;/P&gt;&lt;P&gt;18/12/2012 C 900&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Which will then return sales of 2400 instead of the correct answer of 4500&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be great if you could point out the flaw in my logic!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 09:56:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412175#M488311</guid>
      <dc:creator />
      <dc:date>2013-01-11T09:56:39Z</dc:date>
    </item>
    <item>
      <title>Re: Using nested functions within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412176#M488312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;$ respects the current User selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if a user selects "Customer A", my expression will only return YTD for this Customer.&lt;/P&gt;&lt;P&gt;--&amp;gt; my expression says: Respect all Userselections, but overwrite the date selection with =&amp;gt;1/1/2012&amp;lt;=18/12/2012&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you use "1" in set analysis, qlikview will ignore the user's "Customer A" selection, and will return all Sales between "=&amp;gt;1/1/2012&amp;lt;=18/12/2012"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would say "$" is more often used than "1"ö, as typically the user has done selection in various fields (article, customer, country) and you only want to overwrite the timeselection..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 11:31:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412176#M488312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-11T11:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using nested functions within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412177#M488313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much for that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right, Think i can understand it better now. So the formulas withing the curly brackets merely override the SelectDate figures.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Last question - What does the only() function do?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 11:46:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412177#M488313</guid>
      <dc:creator />
      <dc:date>2013-01-11T11:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Using nested functions within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412178#M488314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;it ensures that only() ONE date is selected; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a user has multiple dates selected, it will return NULL.&lt;/P&gt;&lt;P&gt;Otherwise you could use the min() or max() function instead of only(). As long as just one date is selected, it wont make any difference..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2013 11:52:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412178#M488314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-01-11T11:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using nested functions within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412179#M488315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi There,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So a few days ago, I loaded January data into the Qlikview file, and Ive noticed 2 things.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. The function above seems to capture Year to date figures for 2012 and 2013 when the user clicks on a 2013 week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. I also mimiced the above functions and replaced "yearstart" with "quarterstart" but it gives me the exact data as the previous functions, i.e the sum of sales for all weeks in 2012 and 2013.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any way to rectify this? I thought the functions yearstar and quarterstart were supposed to return the earliest date of that year/quarter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for all your help and I hope to hear from you soon&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jan 2013 12:15:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412179#M488315</guid>
      <dc:creator />
      <dc:date>2013-01-28T12:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using nested functions within Set Analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412180#M488316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My Apologies, your expressions work perfectly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jan 2013 12:05:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-nested-functions-within-Set-Analysis/m-p/412180#M488316</guid>
      <dc:creator />
      <dc:date>2013-01-31T12:05:38Z</dc:date>
    </item>
  </channel>
</rss>

