<?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: Programmatically change alternate state values in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1776973#M60253</link>
    <description>&lt;P&gt;you dont need alternating states for this, you can use set analysis:&lt;BR /&gt;&lt;BR /&gt;{&amp;lt;... YEAR={$(=only(YEAR)-1)}...&amp;gt;}&lt;/P&gt;</description>
    <pubDate>Sun, 24 Jan 2021 20:27:21 GMT</pubDate>
    <dc:creator>edwin</dc:creator>
    <dc:date>2021-01-24T20:27:21Z</dc:date>
    <item>
      <title>Programmatically change alternate state values</title>
      <link>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1776625#M60212</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have an app where the user chooses an machine and a year from an filter pane and i show him different performance values.&lt;/P&gt;&lt;P&gt;i have one diagram where i show him the data per calendar week and one where the whole year is summarised.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i want to add another diagram where i show him the summarised values for the last year.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-01-22 084817.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/47638i7AEDD12D20465D98/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-01-22 084817.png" alt="Screenshot 2021-01-22 084817.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;What i did was to create an alternate state and that would work fine. Problem is usability.&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If an user selects a year, i want to automatically change the value in the alternate state to the last year.&lt;/LI&gt;&lt;LI&gt;If a user selects a machine, it should do so also in the alternate_state.&amp;nbsp;&lt;UL&gt;&lt;LI&gt;i would have the possibility to only work with the default state, but not when the field has the property "&lt;SPAN&gt;Always one selected value"&lt;/SPAN&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN&gt;I still could only work with the default state, but it gets so confusing in the filter.&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;Is there a way to&amp;nbsp;programmatically change the values in the alternate state when the values change in the default state?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Or is there another way simpler solution?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 22 Jan 2021 07:51:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1776625#M60212</guid>
      <dc:creator>HDbrpJA8E4</dc:creator>
      <dc:date>2021-01-22T07:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically change alternate state values</title>
      <link>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1776973#M60253</link>
      <description>&lt;P&gt;you dont need alternating states for this, you can use set analysis:&lt;BR /&gt;&lt;BR /&gt;{&amp;lt;... YEAR={$(=only(YEAR)-1)}...&amp;gt;}&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jan 2021 20:27:21 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1776973#M60253</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-01-24T20:27:21Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically change alternate state values</title>
      <link>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1777026#M60259</link>
      <description>&lt;P&gt;Hi thanks, got it.&lt;BR /&gt;But now i have another issue.&lt;/P&gt;&lt;P&gt;I did define my Measures, with colours and everything,&amp;nbsp; like this:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(sum(made_pieces)/sum(productive_duration_sec))*3600&lt;/LI-CODE&gt;&lt;P&gt;But now i need another measure for the previous year:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;(sum({&amp;lt;booking_isoyear={$(=booking_isoyear-1)}&amp;gt;}made_pieces)/sum({&amp;lt;booking_isoyear={$(=booking_isoyear-1)}&amp;gt;}productive_duration_sec))*3600&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Do i have another option than to define every Measure twice?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 08:27:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1777026#M60259</guid>
      <dc:creator>HDbrpJA8E4</dc:creator>
      <dc:date>2021-01-25T08:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically change alternate state values</title>
      <link>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1777031#M60260</link>
      <description>&lt;P&gt;You will have to modify all the expressions where you want to show last year value. Better would be you create a variable and use that is all your expression, so next time if you want to change from last year to previous 2 year , you can simply achieve that by modifying the variable. Like this:&lt;/P&gt;&lt;P&gt;vPreviousYear = Year(Max(booking_isoyear))-1&lt;/P&gt;&lt;P&gt;(sum({&amp;lt;booking_isoyear={$(vPreviousYear )}&amp;gt;}made_pieces)/sum({&amp;lt;booking_isoyear = {$(vPreviousYear)}&amp;gt;}productive_duration_sec))*3600&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 09:09:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1777031#M60260</guid>
      <dc:creator>jyothish8807</dc:creator>
      <dc:date>2021-01-25T09:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically change alternate state values</title>
      <link>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1777321#M60302</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for your answer. I made it as you said and everything is working fine. However, i do not really like this solution as i have to define the same Measure twice.&lt;/P&gt;&lt;P&gt;I do still think working with alternate states would be the cleanest solution, if it would be possible to trigger an change somehow.&lt;/P&gt;&lt;P&gt;I keep it open in the meantime, maybe someone else comes up with a different solution.&lt;/P&gt;&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 07:11:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1777321#M60302</guid>
      <dc:creator>HDbrpJA8E4</dc:creator>
      <dc:date>2021-01-26T07:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Programmatically change alternate state values</title>
      <link>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1777458#M60317</link>
      <description>&lt;P&gt;if you want to use alt states, you can specify the state when you are adding your triggers.&amp;nbsp; you first define your alt state in doc settings, then in field triggers:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="edwin_0-1611672405940.png" style="width: 400px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/47787iAE41C5172EBBC7CC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="edwin_0-1611672405940.png" alt="edwin_0-1611672405940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 14:46:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Programmatically-change-alternate-state-values/m-p/1777458#M60317</guid>
      <dc:creator>edwin</dc:creator>
      <dc:date>2021-01-26T14:46:55Z</dc:date>
    </item>
  </channel>
</rss>

