<?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: Can I make this if-expression dynamic in a table? in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497843#M1144710</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an example of how you can solve is in the application. You need to use a chart and not a table box, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 09 Sep 2013 07:55:51 GMT</pubDate>
    <dc:creator>johanlindell</dc:creator>
    <dc:date>2013-09-09T07:55:51Z</dc:date>
    <item>
      <title>Can I make this if-expression dynamic in a table?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497842#M1144709</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;In the script I use this expression to calculate if a person has been active for * &amp;gt; 36 month/ &amp;gt; 10 months / &amp;lt; 10 months. The calcultions are based on the latest event-date (BOKDAT) vs the first event-date. Because I do this in the script it become static, I would like to do this dynamic in the app to make the calculation based on the month the user select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can that be done?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;
&lt;P&gt; Left join&lt;/P&gt;
&lt;SPAN style="font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;&lt;STRONG style="color: #0000ff; font-size: 8pt;"&gt;Load&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BOKDAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'YYYY-MM-DD')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[Latest BOKDAT]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BOKDAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'YYYY-MM-DD')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[First BOKDAT]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BOKDAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'YYYY-MM-DD')) &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ADDMONTHS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BOKDAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'YYYY-MM-DD')),-36), '&amp;gt; 36 Month',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;If&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Min&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BOKDAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,'YYYY-MM-DD')) &amp;lt;= &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;ADDMONTHS&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Max&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Date&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;BOKDAT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, 'YYYY-MM-DD')),-10), '&amp;gt; 10 Month',&lt;BR /&gt;'&amp;lt; 10 Month')) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;as&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Time&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;, &lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;INSNR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Resident&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; B &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;Group&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;by&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;INSNR&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;; &lt;/SPAN&gt;&lt;/SPAN&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 07:24:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497842#M1144709</guid>
      <dc:creator />
      <dc:date>2013-09-09T07:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make this if-expression dynamic in a table?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497843#M1144710</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's an example of how you can solve is in the application. You need to use a chart and not a table box, though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 07:55:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497843#M1144710</guid>
      <dc:creator>johanlindell</dc:creator>
      <dc:date>2013-09-09T07:55:51Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make this if-expression dynamic in a table?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497844#M1144711</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm pretty sure what you want is possible. But I don't understand what you want. Perhaps the attached qvw. If not please explain in more detail what you want to achieve. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 08:22:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497844#M1144711</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2013-09-09T08:22:36Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Can I make this if-expression dynamic in a table?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497845#M1144712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I will look into the atteched files from both of you. But let me try to explain a bit better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would like the Time-calculaton be based on the month that the user select in the calendar. I have here narrowed the data to one ID that have monthly regulary events from 2010-10 until 2013-05. If then the user select (in the calendar) 2010-11 the Time-calculation should show &amp;lt; 10 months becasue in 2010-11 the Id/person had only been active for 1 month. But if the user select 2013-05 it should show "&amp;gt; 10 months" because then the person has been active for more then 10 months.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The intervalls should be: Less the 10 months / more then 10 months but less then 36 months / more then 36 months&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 08:46:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497845#M1144712</guid>
      <dc:creator />
      <dc:date>2013-09-09T08:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Can I make this if-expression dynamic in a table?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497846#M1144713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;With your help it looks like I have a start to the solution.&lt;/P&gt;&lt;P&gt;In a chart I use the following expression so it compare the first event-date against the "Datum" = Date-field in the calendar. It look like it work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[First BOKDAT]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AddMonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,-36),'&amp;gt; 36 Month',&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[First BOKDAT]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;lt;=&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;AddMonths&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;Datum&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;,-10),'&amp;gt; 10 Month',&lt;BR /&gt;'&amp;lt; 10 Month')) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For a ID that have the following evendates&lt;/P&gt;&lt;P&gt;2010-01-21&lt;/P&gt;&lt;P&gt;2010-04-01&lt;/P&gt;&lt;P&gt;2013-03-21&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;If I select 2010-04 it shows &amp;lt; 10 months. And for 2013-03 it shows &amp;gt; 36 months. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757; font-size: 10pt;"&gt;&lt;STRONG&gt;The new problem &lt;/STRONG&gt;now is that if I select 2013-02 it do not show anything because the Person/ID don´have any event that month (and the connection tohe calendare are based on the event-date). But because there do exist a larger event-date (ie the persons act was open in 2013-02) I would like it count even for this month. Can that be made, I guees in the script with some "makedate" function to fill the act with dates to make a connection to the calendar. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;&amp;nbsp; Edit: Maby not makedate but generate/fill&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt; the list of event-date so it has atleast one date every month upp to the latest event-date. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 09:21:45 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497846#M1144713</guid>
      <dc:creator />
      <dc:date>2013-09-09T09:21:45Z</dc:date>
    </item>
    <item>
      <title>Re: Can I make this if-expression dynamic in a table?</title>
      <link>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497847#M1144714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The problem with using the same field for selecting a month as the field in the calender is that you make a selection in the calender and you then want to calculate "stuff" outside of this selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of ways to go around this:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;make a new year-month field that is not connected and use this value to determine the range to be used&lt;/LI&gt;&lt;LI&gt;use the same field, but have a listbox in an "Alternate State" and use the selection in the Alternate Stats to determine the range to be used&lt;/LI&gt;&lt;LI&gt;Use set expressions to override the selections made in the YearMonth-field. This may be tricky as not all formulas allow Set Expression. Dimensions does not work with Set Expressions unless you make formulas here also.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd go for the no 2. A formula for retrieveng the selected month would be:&lt;/P&gt;&lt;P&gt;=Only({SecondState} ÅrMån)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A general recommendation (which also would make this easier for you) is to have real "dates" behind fields like YearMonth. This you achieve by creating the field ÅrMån as:&lt;/P&gt;&lt;P&gt;Date(MonthStart(Temp_Datum), 'YYYYMM') as ÅrMån&lt;/P&gt;&lt;P&gt;This will for instance allow you to easier calculate how many months back the selected date is as well as a number of other good things. I attach a new file.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 09 Sep 2013 11:56:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Can-I-make-this-if-expression-dynamic-in-a-table/m-p/497847#M1144714</guid>
      <dc:creator>johanlindell</dc:creator>
      <dc:date>2013-09-09T11:56:58Z</dc:date>
    </item>
  </channel>
</rss>

