<?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: Find out how many months back a user_selection is? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802654#M283377</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you have also numeric fields to these string-field (is recommended) in your datamodel you could use them like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;only({&amp;lt; NumericMonth = {"$(=max(NumericMonth)-1)"}&amp;gt;} StringMonth)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the user selection would it return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Feb 2015 11:55:01 GMT</pubDate>
    <dc:creator>marcus_sommer</dc:creator>
    <dc:date>2015-02-13T11:55:01Z</dc:date>
    <item>
      <title>Find out how many months back a user_selection is?</title>
      <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802652#M283375</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;I have, on the GUI of my app, a listbox with month_year combinations like&lt;/P&gt;&lt;P&gt;- Dez_14&lt;/P&gt;&lt;P&gt;- Jan_15&lt;/P&gt;&lt;P&gt;- Feb_15&lt;/P&gt;&lt;P&gt;... each month, one column will be added to those.&lt;/P&gt;&lt;P&gt;=&amp;gt; Based on the user's selection of these, i have to dynamically find out what was the month before&lt;/P&gt;&lt;P&gt;==&amp;gt;&amp;gt; Example: If the user selects "Jan_15", then that shall be displayed in the chart - and the month before which is "Dez_14".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone give me an idea how to do this without using a really long IF() formula?&lt;/P&gt;&lt;P&gt;Thanks a lot!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 11:18:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802652#M283375</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-02-13T11:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Find out how many months back a user_selection is?</title>
      <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802653#M283376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do it in the reload script :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a distinct list of month_year and use the Previous function to get the value before. No heavy calculations needed in the front end this way...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 11:21:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802653#M283376</guid>
      <dc:creator>giakoum</dc:creator>
      <dc:date>2015-02-13T11:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Find out how many months back a user_selection is?</title>
      <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802654#M283377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you have also numeric fields to these string-field (is recommended) in your datamodel you could use them like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;only({&amp;lt; NumericMonth = {"$(=max(NumericMonth)-1)"}&amp;gt;} StringMonth)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then the user selection would it return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 11:55:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802654#M283377</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-02-13T11:55:01Z</dc:date>
    </item>
    <item>
      <title>Re: Find out how many months back a user_selection is?</title>
      <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802655#M283378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks ioannis!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's a reason though why I wrote "on the GUI" in my post &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; I cannot yet think of any way to do it in the script:&lt;/P&gt;&lt;P&gt;The user_selections are made on the GUI - the user decides which months he/ she wants to see - and the values I have in the script (loaded from an Excel I have prepared for general use) only include month_names, no year.&lt;/P&gt;&lt;P&gt;=&amp;gt; So the PREVIOUS() function used on that table would not even work because "Jan" is the very 1st line of the table.&lt;/P&gt;&lt;P&gt;I have a variable containing the current year. Combining those two gives me the values I have in the listbox on my GUI&lt;/P&gt;&lt;P&gt;=&amp;gt; Ex.: Now (in Feb), only Jan_15 is selectable, so the month prior to that would be Dec_14. In a function, I'd need the parameter -2 to get that.&lt;/P&gt;&lt;P&gt;=&amp;gt; In March, Feb_15 or Jan_15 will be selectable. If Feb_15 is selected, I will need the parameter -2 to&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamically get to Jan_15, the month prior to that. &amp;lt;=&amp;gt; if Jan_15 is selected, I would need the parameter -3 to get&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; to Dec_14, the month prior to that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=&amp;gt; If I could find out how many months back (from a dynamically calculated Today() the user_selection is, then I would just have to add 1 to get the parameter needed to dynamically go back to that month's prior_month ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 11:57:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802655#M283378</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-02-13T11:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Find out how many months back a user_selection is?</title>
      <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802656#M283379</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;I will try some "thinking out of the box" and simplify that by adding a little bit of logic to the underlying Excel_file (the one I use for the month_names) =&amp;gt; I will calculate in that file the number of months I have to go back from "Today" to every one of the months listed there - that will give me, e.g. in December&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - a value of 1 to go back to Nov&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 2 to go back to Oct&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - 11 to back to Jan&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then&lt;/P&gt;&lt;P&gt;- in December there will be data in the file for all the months from Jan through Nov, so those months will be&lt;BR /&gt;&amp;nbsp;&amp;nbsp; selectable in that listbox.&lt;/P&gt;&lt;P&gt;=&amp;gt; If Nov_15 is selected, I will get from that table a value of 1 - meaning that to get the month prior to that, I will need&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2, so I just need to add 1 to that value.&lt;/P&gt;&lt;P&gt;=&amp;gt; If Jan_15 is selected, I will get 11 - meaning that to get the month prior, I will need 12, so I need to add 1.&lt;/P&gt;&lt;P&gt;==&amp;gt;&amp;gt; Done!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DataNibbler&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 12:11:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802656#M283379</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-02-13T12:11:14Z</dc:date>
    </item>
    <item>
      <title>Re: Find out how many months back a user_selection is?</title>
      <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802657#M283380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi DataNibbler,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;why don't you use a transforming into numeric values within the data-load like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date(date#('Nov_15', 'MMM_YY'), 'DD.MM.YYYY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- Marcus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 12:21:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802657#M283380</guid>
      <dc:creator>marcus_sommer</dc:creator>
      <dc:date>2015-02-13T12:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Find out how many months back a user_selection is?</title>
      <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802658#M283381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your calendar:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Load *,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Autonumber(MonthYear,&lt;SPAN style="font-size: 13.3333330154419px;"&gt;'MonthYears'&lt;/SPAN&gt;) as MonthYearNo;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then in your gui you can reference the previous month as:&lt;BR /&gt;Only({&amp;lt;MonthYearNo={$(=Max(MonthYearNo)-1)}&amp;gt;} MonthYear)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or in a calculation: Sum({&amp;lt;MonthYearNo={$(=Max(MonthYearNo)-1)}&amp;gt;} Amount)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 12:28:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802658#M283381</guid>
      <dc:creator>simenkg</dc:creator>
      <dc:date>2015-02-13T12:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Find out how many months back a user_selection is?</title>
      <link>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802659#M283382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks for all your suggestions!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I'm happy with the solution I have finally found. And I can put that right back INTO the box because QlikView can of&amp;nbsp; course do that calculation, too - I just calculate dynamically in the LOAD one field with the dynamically calculated nr. of months I have to go back from "Today" to the month in that line.&lt;/P&gt;&lt;P&gt;Then I just add 1 and I have the parameter I need for the month before that.&lt;/P&gt;&lt;P&gt;=&amp;gt; Voila, I have the names of the two fields that I need to display.&lt;/P&gt;&lt;P&gt;I'll see if it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Feb 2015 14:06:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Find-out-how-many-months-back-a-user-selection-is/m-p/802659#M283382</guid>
      <dc:creator>datanibbler</dc:creator>
      <dc:date>2015-02-13T14:06:05Z</dc:date>
    </item>
  </channel>
</rss>

