<?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 Expression with Altered State in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777596#M275625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a table that compares two time periods. The end user can define "current period" and "prior period". The user should have the option of comparing the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Current [Month] to Previous [Month]&lt;/P&gt;&lt;P&gt;* Current [Quarter] to Previous [Quarter]&lt;/P&gt;&lt;P&gt;* Current [Year] to Previous [Year]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have established that the best way to handle this is by using altered states so I have created a "Group 1" which will be Current Period and "Group 2" which will be Prior Period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My table should ultimately look like this, where the user selected Q4 2014 as Current Period, as an example, and Q3 2014 for Prior Period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="107" style="border: 1px solid rgb(0, 0, 0); border-image: none; width: 401px; height: 108.79px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Metric&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;P&gt;&lt;STRONG&gt;Prior Period&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q3 2014&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;P&gt;&lt;STRONG&gt;Current Period&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q4 2014&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Difference&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Total Dollars&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;$100,000&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;$130,000&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;30.0%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Total People&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;347&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;&lt;P&gt;301&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;-13.3%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will need to have separate filters for each group. Both filters will include the same information but the user can select different dates to compare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My filter:&lt;/P&gt;&lt;P&gt;Multi Box that includes a three drop downs options; one for year, one for QuarterYear, and one for MonthYear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the user should only be able to select one of the three options within one group. A Year or a QuarterYear, or a MonthYear (i.e. 2014 or Dec 2014 or Q4 2014)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible to do? Can someone help me out with the expressions that I need to use? One expression will be in the column header to make the date reference dynamic and the other would be in the cells in each column to actually add data just from the selected time period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm tackling this one step at a time so this is the next step to my first question on how to achieve the prior / current comparison...answer was to user alternate states, which I'm now trying to do:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Jan 2015 20:34:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2015-01-12T20:34:05Z</dc:date>
    <item>
      <title>Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777596#M275625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to create a table that compares two time periods. The end user can define "current period" and "prior period". The user should have the option of comparing the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Current [Month] to Previous [Month]&lt;/P&gt;&lt;P&gt;* Current [Quarter] to Previous [Quarter]&lt;/P&gt;&lt;P&gt;* Current [Year] to Previous [Year]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have established that the best way to handle this is by using altered states so I have created a "Group 1" which will be Current Period and "Group 2" which will be Prior Period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My table should ultimately look like this, where the user selected Q4 2014 as Current Period, as an example, and Q3 2014 for Prior Period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="107" style="border: 1px solid rgb(0, 0, 0); border-image: none; width: 401px; height: 108.79px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;Metric&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;P&gt;&lt;STRONG&gt;Prior Period&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q3 2014&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;P&gt;&lt;STRONG&gt;Current Period&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Q4 2014&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Difference&lt;/STRONG&gt;&lt;/P&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Total Dollars&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;$100,000&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;$130,000&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;30.0%&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px;"&gt;Total People&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;347&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;&lt;P&gt;301&lt;/P&gt;&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: right;"&gt;-13.3%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will need to have separate filters for each group. Both filters will include the same information but the user can select different dates to compare.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My filter:&lt;/P&gt;&lt;P&gt;Multi Box that includes a three drop downs options; one for year, one for QuarterYear, and one for MonthYear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So the user should only be able to select one of the three options within one group. A Year or a QuarterYear, or a MonthYear (i.e. 2014 or Dec 2014 or Q4 2014)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this possible to do? Can someone help me out with the expressions that I need to use? One expression will be in the column header to make the date reference dynamic and the other would be in the cells in each column to actually add data just from the selected time period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm tackling this one step at a time so this is the next step to my first question on how to achieve the prior / current comparison...answer was to user alternate states, which I'm now trying to do:)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 20:34:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777596#M275625</guid>
      <dc:creator />
      <dc:date>2015-01-12T20:34:05Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777597#M275626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;am not sure if this is what you are looking. Please look at the attached file. Let me know if you have a different question.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 20:58:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777597#M275626</guid>
      <dc:creator>reshmakala</dc:creator>
      <dc:date>2015-01-12T20:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777598#M275627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your example is exactly what I was looking for. Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am, however, having trouble implementing it with my data. Do you know what might be wrong with this expression?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;(&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({Group 2}&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[LocationID]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;)) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting an error with the opening squiggly bracket...not the closing.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Jan 2015 21:30:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777598#M275627</guid>
      <dc:creator />
      <dc:date>2015-01-12T21:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777599#M275628</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome. Sorry for the delay. There is a small correction in your expression. &lt;/P&gt;&lt;P&gt;Please try &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count ( {Group2} DISTINCT (LocationID) )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if that doesn't work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 14:28:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777599#M275628</guid>
      <dc:creator>reshmakala</dc:creator>
      <dc:date>2015-01-13T14:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777600#M275629</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It looks like the syntax is correct however it's returning null and the answer should be 171. Any thoughts on why it would return null?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I entered as the expression...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;count&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;({&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;[Group 2]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;}&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt;"&gt;DISTINCT&lt;/SPAN&gt;&lt;SPAN style="color: #800000; font-size: 8pt;"&gt;[LocationID]&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt;"&gt;) &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 15:09:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777600#M275629</guid>
      <dc:creator />
      <dc:date>2015-01-13T15:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777601#M275630</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you attach a file with sample data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 15:12:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777601#M275630</guid>
      <dc:creator>reshmakala</dc:creator>
      <dc:date>2015-01-13T15:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777602#M275631</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 15:14:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777602#M275631</guid>
      <dc:creator>reshmakala</dc:creator>
      <dc:date>2015-01-13T15:14:29Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777603#M275632</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not seeing a file if you attached one with your "see this" post...BUT I was just playing around with it and somehow I tweaked something and it works!! Not sure what the magic change was but what matters is it is returning the correct amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much, Reshma. Your example is what helped me through it. &lt;IMG src="https://community.qlik.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 15:40:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777603#M275632</guid>
      <dc:creator />
      <dc:date>2015-01-13T15:40:39Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777604#M275633</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One other question, Reshma...in your example you have one row of data. How would you set it up if you needed to have several rows of data where you show the group1 and group2 results in separate columns?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 15:49:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777604#M275633</guid>
      <dc:creator />
      <dc:date>2015-01-13T15:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777605#M275634</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In my example, I just did a summation of data values, when you use pivot table and have multiple rows, you would be able to find the same with you current selections.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 16:15:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777605#M275634</guid>
      <dc:creator>reshmakala</dc:creator>
      <dc:date>2015-01-13T16:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777606#M275635</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 16:15:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777606#M275635</guid>
      <dc:creator>reshmakala</dc:creator>
      <dc:date>2015-01-13T16:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777607#M275636</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Okay so it sounds to me like this can't be done in a straight table. I will swap it out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thank you for your help, Reshma.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Jan 2015 21:14:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777607#M275636</guid>
      <dc:creator />
      <dc:date>2015-01-13T21:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Expression with Altered State</title>
      <link>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777608#M275637</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You're welcome! Happy learning!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Jan 2015 14:54:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Expression-with-Altered-State/m-p/777608#M275637</guid>
      <dc:creator>reshmakala</dc:creator>
      <dc:date>2015-01-14T14:54:41Z</dc:date>
    </item>
  </channel>
</rss>

