<?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: Re: Re: Comparative view – Alternate States – Variables – Triggers in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622832#M477381</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternate states is not needed for the variables or the calendars.&amp;nbsp; I think that is why you were getting unexpected results.&amp;nbsp; See attached for a simplified working example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Apr 2014 05:00:24 GMT</pubDate>
    <dc:creator>Josh_Good</dc:creator>
    <dc:date>2014-04-29T05:00:24Z</dc:date>
    <item>
      <title>Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622826#M477375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A couple months ago I found an article that allowed me to give the users control over the selecting the date range for and followed the suggestions in &lt;A href="http://www.bi-tv.com/how-to-add-start-date-and-end-date-calendar-objects-in-qlikview/"&gt;this post&lt;/A&gt; and outside of a &lt;A _jive_internal="true" href="https://community.qlik.com/thread/46422"&gt;minor issue&lt;/A&gt; with the back button it has been working fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I have a new requirement to implement a comparative view and I’m not successfully incorporating this into the alternate states the comparative view has to use.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the stripped-down scrambled version of the application I’m attaching you can see how the comparative view isn’t quite working as I hoped it would.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Navigate to the ‘Compare’ tab.&amp;nbsp; Make sure all selections are clear.&amp;nbsp; Pick August 1, 2013 in the ‘Group A’ start date (top-left) and September 12, 2013 for ‘Group A’ end date (bottom-left).&amp;nbsp; We’re left with a full-blue bar for August and a half a blue bar for September which is what we want as far as that goes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You’ll notice that under ‘Group B’ you can only pick the Start Date.&amp;nbsp; This is because the requirements state that ‘Group B’ End Date needs to be calculated by taking the number of days between Group A’s start and end date and add those same number of days to whatever Group B’s start date. This also works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is with the chart.&amp;nbsp; Given that there is a approximately 1.5 months between the dates in Group A there should be approximately 1.5 months worth of bars rendered on the chart. Pick various start dates for Group B and you can see that the chart does not correctly calculate.&amp;nbsp; However, if you pick the same Group B start date twice it will show up correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the attached file you’ll find (amongst others) six variables: vStartDate, vEndDate, vStartDateGroupA, vEndDateGroupA, vStartDateGroupB and vEndDateGroupB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These variables are acted upon in various places:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Settings -&amp;gt; Document Properties -&amp;gt; Triggers -&amp;gt; Document Event Triggers -&amp;gt; OnAnySelect&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Settings -&amp;gt; Document Properties -&amp;gt; Triggers -&amp;gt; Variable Event Triggers -&amp;gt; {all variables listed above}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;{Each calendar control} -&amp;gt; Properties -&amp;gt; General -&amp;gt; Min Value &amp;amp; Max Value&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your consideration in assisting me with this vexing issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 20:10:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622826#M477375</guid>
      <dc:creator />
      <dc:date>2014-04-25T20:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622827#M477376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is happening is QlikView is calculating the values of vStartDateGroupB and vEndDateGroupB in parallel.&amp;nbsp; So when determining the vEndDateGroupB, it is using your 'old' value of vStartDateGroupB.&amp;nbsp; Thus on the second time selected the 'old' value is the 'correct' value so you get the result you are looking for.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the definition of vEndDateGroupB to be the expression you are using in to set the value in the trigger on vStartDateGroupB and remove action(s) that sets vEndDateGroupB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Josh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS glad you found my video helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Apr 2014 21:08:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622827#M477376</guid>
      <dc:creator>Josh_Good</dc:creator>
      <dc:date>2014-04-25T21:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622828#M477377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Josh --&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I understand what you're saying and it makes sense but I'm afraid the I must not be implementing your suggestion correctly.&amp;nbsp; I've removed the actions that updated vEndDateGroupB and attempted various ways to use the expression as the variable's definition.&amp;nbsp; For one example, in the load script I have:&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LET vEndDateGroupB = Date(vStartDateGroupB + (Date(vEndDateGroupA, 'M/D/YYYY') - Date(vStartDateGroupA, 'M/D/YYYY')), 'M/D/YYYY');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, it simply sets the variable to the last date of the data set and leaves it there no matter what I select for dates in the other calendar controls.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And yes, I found your video very helpful.&amp;nbsp; The customers particularly like how the date will reflect the range of their other selections.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 15:44:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622828#M477377</guid>
      <dc:creator />
      <dc:date>2014-04-28T15:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622829#M477378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I played around with it for a while and found I was unable to manually change the vEndDateGroupB.&amp;nbsp; I suspect there is an action somewhere that is change the variable back but couldn't find it.&amp;nbsp; I would suggest you try creating a new QVW that only does this date action and see if that works.&amp;nbsp; That will prove out if the approach is wrong or if there is a setting in the current QVW that is overriding our efforts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 16:26:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622829#M477378</guid>
      <dc:creator>Josh_Good</dc:creator>
      <dc:date>2014-04-28T16:26:51Z</dc:date>
    </item>
    <item>
      <title>Re: Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622830#M477379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I really appreciate you taking the time to work with me on this.&amp;nbsp; I'll work on getting a new app together to see if we can demonstrate this functionality without any possible conflicts from other aspects of the app.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was struck with a thought that I hand't mentioned.&amp;nbsp; I can't imagine why this would have anything to do with it but just in case -- one of the things I did to try and make this work was to copy the trans_posted_date field into their own dates (GrpA_trans_posted_date and GrpB_trans_posted_date) so each group's dates aren't fighting with each other.&amp;nbsp; Do you think this is this an undesirable approach that might be complicating the solution?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 17:49:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622830#M477379</guid>
      <dc:creator />
      <dc:date>2014-04-28T17:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622831#M477380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As requested here is a new QVW with nothing but the comparative tab and the controls needed.&amp;nbsp; I should forewarn you that this one works less than the original version.&amp;nbsp; Faced with the decision to get this one to work better vs. putting up a version that has the minimal alterations I went with the later.&amp;nbsp; I was afraid I'd introduce too much extraneous code and violate the spirit of what we were hoping to accomplish so I put in what I thought were the least amount of triggers and code required even if it doesn't do much of anything.&amp;nbsp; I hope this helps.&amp;nbsp; I'll be taking the version I have and try to get it to work but thought this version should be the one to post in the meantime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dave&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Apr 2014 20:50:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622831#M477380</guid>
      <dc:creator />
      <dc:date>2014-04-28T20:50:42Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622832#M477381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dave,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alternate states is not needed for the variables or the calendars.&amp;nbsp; I think that is why you were getting unexpected results.&amp;nbsp; See attached for a simplified working example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Josh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 05:00:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622832#M477381</guid>
      <dc:creator>Josh_Good</dc:creator>
      <dc:date>2014-04-29T05:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622833#M477382</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is brilliant.&amp;nbsp; Thank you so much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 13:16:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622833#M477382</guid>
      <dc:creator />
      <dc:date>2014-04-29T13:16:54Z</dc:date>
    </item>
    <item>
      <title>Re: Re: Re: Re: Comparative view – Alternate States – Variables – Triggers</title>
      <link>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622834#M477383</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Happy to help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Apr 2014 13:28:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Comparative-view-Alternate-States-Variables-Triggers/m-p/622834#M477383</guid>
      <dc:creator>Josh_Good</dc:creator>
      <dc:date>2014-04-29T13:28:55Z</dc:date>
    </item>
  </channel>
</rss>

