<?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 I need =P() for last year selection, not current year selection in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/I-need-P-for-last-year-selection-not-current-year-selection/m-p/353077#M493438</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, I dug around the reference file to find the solution. I ended up using &lt;/P&gt;&lt;P&gt;Company=P({&amp;lt;[Category Description]=P(),[Fiscal Year]={"$(=([Fiscal Year])-1)"},[Fiscal Period]=P()&amp;gt;}Company)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 May 2012 11:48:05 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-05-16T11:48:05Z</dc:date>
    <item>
      <title>I need =P() for last year selection, not current year selection</title>
      <link>https://community.qlik.com/t5/QlikView/I-need-P-for-last-year-selection-not-current-year-selection/m-p/353075#M493436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Current Year:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;(sum(if(wildmatch([GL Account],'5*','6*'),[Journal Debit Amount]))-sum(if(wildmatch([GL Account],'5*','6*'),[Journal Credit Amount])))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({1&amp;lt;[Top Income]={'Sales'},Company=P(),[Fiscal Period]=P(),[Fiscal Year]=P()&amp;gt;} ([Credit Amount]+[Debit Amount])* (-1))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Previous Year:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_text_macro jive_macro_code"&gt;&lt;P&gt;(sum({&amp;lt;[Fiscal Period]=P(),[Fiscal Year]={"$(=([Fiscal Year])-1)"}&amp;gt;}&lt;/P&gt;&lt;P&gt;if(wildmatch([GL Account],'5*','6*'),[Journal Debit Amount]))-&lt;/P&gt;&lt;P&gt;sum({&amp;lt;[Fiscal Period]=P(),[Fiscal Year]={"$(=GetFieldSelections([Fiscal Year])-1)"}&amp;gt;}&lt;/P&gt;&lt;P&gt;if(wildmatch([GL Account],'5*','6*'),[Journal Credit Amount])))&lt;/P&gt;&lt;P&gt;/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum({1&amp;lt;[Top Income]={'Sales'},Company=P(),[Fiscal Period]=P(),[Fiscal Year]={"$(=([Fiscal Year])-1)"}&amp;gt;} ([Credit Amount]+[Debit Amount])* (-1))&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the above 2 expressions that I am using to compare current year expense percentage of revenue vs last year expense percentage of revenue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First off, I have the fiscal year set to always 1 selected value. Currently I have 2012 selected. In 2012 there are 4 companies (with current selection of expense) available. Last year there was only one for current selections of expense. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above 2 formulas return the correct expense amounts for each year. However due to Company=P() part of last year revenue set I am pulling all 4 compaines saves vs the only 1 companies expenses. This is making the values different then they actually were.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anyway to tell the set to take the possible Companies for the same selection, but assuming it was last year and not this year?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 21:04:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/I-need-P-for-last-year-selection-not-current-year-selection/m-p/353075#M493436</guid>
      <dc:creator />
      <dc:date>2012-05-15T21:04:46Z</dc:date>
    </item>
    <item>
      <title>I need =P() for last year selection, not current year selection</title>
      <link>https://community.qlik.com/t5/QlikView/I-need-P-for-last-year-selection-not-current-year-selection/m-p/353076#M493437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Have you tried:&lt;BR /&gt;Company= P({1&amp;lt;[Fiscal Year]={"$(=([Fiscal Year])-1)"}&amp;gt;} Company) &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 00:42:44 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/I-need-P-for-last-year-selection-not-current-year-selection/m-p/353076#M493437</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-05-16T00:42:44Z</dc:date>
    </item>
    <item>
      <title>I need =P() for last year selection, not current year selection</title>
      <link>https://community.qlik.com/t5/QlikView/I-need-P-for-last-year-selection-not-current-year-selection/m-p/353077#M493438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, I dug around the reference file to find the solution. I ended up using &lt;/P&gt;&lt;P&gt;Company=P({&amp;lt;[Category Description]=P(),[Fiscal Year]={"$(=([Fiscal Year])-1)"},[Fiscal Period]=P()&amp;gt;}Company)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 11:48:05 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/I-need-P-for-last-year-selection-not-current-year-selection/m-p/353077#M493438</guid>
      <dc:creator />
      <dc:date>2012-05-16T11:48:05Z</dc:date>
    </item>
  </channel>
</rss>

