<?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: Question regarding the use of p() in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Question-regarding-the-use-of-p/m-p/2087422#M89146</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;The function P() returns all possible values, and therefore it will be impacted by user selections in all those fields that you wanted to ignore. In order to ignore all selections, except for two fields, I'd use the following syntax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count({1&amp;lt;date=$::date, productId=$::productId&amp;gt;}transactionId)&lt;/LI-CODE&gt;
&lt;P&gt;Set Identifier 1 allows to ignore all user selections, while the two modifiers starting with $:: bring back the &lt;STRONG&gt;&lt;EM&gt;selected&lt;/EM&gt;&lt;/STRONG&gt; (as opposed to &lt;EM&gt;&lt;STRONG&gt;possible&lt;/STRONG&gt;&lt;/EM&gt;) values from the two fields that you wanted to account for.&lt;/P&gt;
&lt;P&gt;To learn more advanced development techniques, including Set Analysis and AGGR(), check out the agenda of the &lt;A href="https://masterssummit.com" target="_blank"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Orlando and to Dublin!&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
    <pubDate>Sat, 24 Jun 2023 14:00:47 GMT</pubDate>
    <dc:creator>Oleg_Troyansky</dc:creator>
    <dc:date>2023-06-24T14:00:47Z</dc:date>
    <item>
      <title>Question regarding the use of p()</title>
      <link>https://community.qlik.com/t5/App-Development/Question-regarding-the-use-of-p/m-p/2087113#M89130</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a question regarding the use of p() and what influences the actual set of possible values.&lt;/P&gt;
&lt;P&gt;My data model consists of transactions that are linked to station id, product Id and a date. The station id is linked to a manager name.&lt;/P&gt;
&lt;P&gt;I want to display a table with the transactions grouped on station level (Table C) and a table that displays the total aggregated values across all stations (Table A and B).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example 1.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/110838i639CC9816F254855/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example 1.png" alt="Example 1.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;The total should disregard any field selections except for selections on date and product. ALL other fields should be ignored.&lt;/P&gt;
&lt;P&gt;I my examples, I have selected a date interval of 1 week. This displays 98296 transactions as expected. But if I make a selection on a station or manager the total changes: &lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Example 2.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/110839i6415DB787CE12F91/image-size/large?v=v2&amp;amp;px=999" role="button" title="Example 2.png" alt="Example 2.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;In table A i am using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count({1&amp;lt;date=p(), productId=p()&amp;gt;}transactionId)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and in table B:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count({1&amp;lt;date=p(), productId=p({$&amp;lt;stationId=&amp;gt;})&amp;gt;}transactionId)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As seen from the screenshots, table B is displaying the correct total, but my problem is that I don't want to add ALL the fields that I wish to ignore to the p() function.&lt;/P&gt;
&lt;P&gt;Lets imagine I have zipcode, adresse, city, region etc linked to the station, and I don't want selections on these to influence my total. Then I would have to add them to the p() function as well.&lt;/P&gt;
&lt;P&gt;As I understand, the p() is providing a set of possible values, but this set of values is influenced by whatever selection is made, and I need to specify what to ignore.&lt;/P&gt;
&lt;P&gt;Also tried:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count({1&amp;lt;date=p(), productId=p({1})&amp;gt;}transactionId)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but then my total won't react to selections in product id, which is one of the requirements.&lt;/P&gt;
&lt;P&gt;I imagine that there is a simple solution, but I haven't been able to find it yet.&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 08:59:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Question-regarding-the-use-of-p/m-p/2087113#M89130</guid>
      <dc:creator>rasmusnielsen</dc:creator>
      <dc:date>2023-06-23T08:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding the use of p()</title>
      <link>https://community.qlik.com/t5/App-Development/Question-regarding-the-use-of-p/m-p/2087422#M89146</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;The function P() returns all possible values, and therefore it will be impacted by user selections in all those fields that you wanted to ignore. In order to ignore all selections, except for two fields, I'd use the following syntax:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count({1&amp;lt;date=$::date, productId=$::productId&amp;gt;}transactionId)&lt;/LI-CODE&gt;
&lt;P&gt;Set Identifier 1 allows to ignore all user selections, while the two modifiers starting with $:: bring back the &lt;STRONG&gt;&lt;EM&gt;selected&lt;/EM&gt;&lt;/STRONG&gt; (as opposed to &lt;EM&gt;&lt;STRONG&gt;possible&lt;/STRONG&gt;&lt;/EM&gt;) values from the two fields that you wanted to account for.&lt;/P&gt;
&lt;P&gt;To learn more advanced development techniques, including Set Analysis and AGGR(), check out the agenda of the &lt;A href="https://masterssummit.com" target="_blank"&gt;Masters Summit for Qlik&lt;/A&gt; - coming soon to Orlando and to Dublin!&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;</description>
      <pubDate>Sat, 24 Jun 2023 14:00:47 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Question-regarding-the-use-of-p/m-p/2087422#M89146</guid>
      <dc:creator>Oleg_Troyansky</dc:creator>
      <dc:date>2023-06-24T14:00:47Z</dc:date>
    </item>
    <item>
      <title>Re: Question regarding the use of p()</title>
      <link>https://community.qlik.com/t5/App-Development/Question-regarding-the-use-of-p/m-p/2087602#M89155</link>
      <description>&lt;P&gt;Thank you Oleg!&lt;/P&gt;
&lt;P&gt;Worked like a charm. Was not aware of the $:: syntax, I need to read up on the alternate states documentation &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Br,&lt;/P&gt;
&lt;P&gt;Rasmus&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 07:15:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Question-regarding-the-use-of-p/m-p/2087602#M89155</guid>
      <dc:creator>rasmusnielsen</dc:creator>
      <dc:date>2023-06-26T07:15:32Z</dc:date>
    </item>
  </channel>
</rss>

