<?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 Setting Selection Criteria as a Variable in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320339#M28490</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an app that has about 60 visualisations across 10 sheets.&amp;nbsp; In each visualisation I am using the same criteria in set analysis to filter the results.&amp;nbsp; This makes it a bit hard for people who are trying to understand what I have done, and also painful if I want to change the standard criteria.&amp;nbsp; So I would like to set the standard criteria that appear on every visualisation up as a variable at a Quote level (the standard unit of counting for this app).&amp;nbsp; Then in each visualisation I want to check if the variable is Yes or No for that Quote and will include / exclude on that basis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for example the standard set analysis criteria are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(distinct{&amp;lt;Q_QUOTE_TrackedQuote={'Yes'},Q_QUOTE_QuoteType-={'Research'},Q_QUOTE_QuoteStatus*={'Issued','Finalised'},&lt;/P&gt;&lt;P&gt; Q_QUOTE_StartDate={"&amp;gt;=$(=date(vStartDate,'DD/MM/YYYY'))&amp;lt;=$(=date(vEndDate,'DD/MM/YYYY'))"}&amp;gt;}CaseID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case I happen to be counting the CaseID, but I might be summing premium or something else, but it always uses the same criteria in the set analysis.&amp;nbsp; This all works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried adding that Set Analysis to a variable like this using AGGR to get an answer at QuoteID level:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(if(count(distinct{&amp;lt;Q_QUOTE_TrackedQuote={'Yes'},Q_QUOTE_QuoteType-={'Research'},Q_QUOTE_QuoteStatus*={'Issued','Finalised'},&lt;/P&gt;&lt;P&gt; Q_QUOTE_StartDate={"&amp;gt;=$(=date(vStartDate,'DD/MM/YYYY'))&amp;lt;=$(=date(vEndDate,'DD/MM/YYYY'))"}&amp;gt;}CaseID)&amp;gt;0,'Yes','No'),QuoteID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried to use the variable in a table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(distinct{&amp;lt;'$(=$(vQuoteIncludedInSelection))='Yes''&amp;gt;}CaseID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried various other syntaxes but still get a series of Nulls as an answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something obvious?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks to you all in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Mar 2017 15:05:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-31T15:05:08Z</dc:date>
    <item>
      <title>Setting Selection Criteria as a Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320339#M28490</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an app that has about 60 visualisations across 10 sheets.&amp;nbsp; In each visualisation I am using the same criteria in set analysis to filter the results.&amp;nbsp; This makes it a bit hard for people who are trying to understand what I have done, and also painful if I want to change the standard criteria.&amp;nbsp; So I would like to set the standard criteria that appear on every visualisation up as a variable at a Quote level (the standard unit of counting for this app).&amp;nbsp; Then in each visualisation I want to check if the variable is Yes or No for that Quote and will include / exclude on that basis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for example the standard set analysis criteria are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(distinct{&amp;lt;Q_QUOTE_TrackedQuote={'Yes'},Q_QUOTE_QuoteType-={'Research'},Q_QUOTE_QuoteStatus*={'Issued','Finalised'},&lt;/P&gt;&lt;P&gt; Q_QUOTE_StartDate={"&amp;gt;=$(=date(vStartDate,'DD/MM/YYYY'))&amp;lt;=$(=date(vEndDate,'DD/MM/YYYY'))"}&amp;gt;}CaseID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this case I happen to be counting the CaseID, but I might be summing premium or something else, but it always uses the same criteria in the set analysis.&amp;nbsp; This all works fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried adding that Set Analysis to a variable like this using AGGR to get an answer at QuoteID level:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aggr(if(count(distinct{&amp;lt;Q_QUOTE_TrackedQuote={'Yes'},Q_QUOTE_QuoteType-={'Research'},Q_QUOTE_QuoteStatus*={'Issued','Finalised'},&lt;/P&gt;&lt;P&gt; Q_QUOTE_StartDate={"&amp;gt;=$(=date(vStartDate,'DD/MM/YYYY'))&amp;lt;=$(=date(vEndDate,'DD/MM/YYYY'))"}&amp;gt;}CaseID)&amp;gt;0,'Yes','No'),QuoteID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I tried to use the variable in a table as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(distinct{&amp;lt;'$(=$(vQuoteIncludedInSelection))='Yes''&amp;gt;}CaseID)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have also tried various other syntaxes but still get a series of Nulls as an answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something obvious?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks to you all in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 15:05:08 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320339#M28490</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-31T15:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Selection Criteria as a Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320340#M28491</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What if you add this to a variable&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vVar&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;{&amp;lt;Q_QUOTE_TrackedQuote={'Yes'},Q_QUOTE_QuoteType-={'Research'},Q_QUOTE_QuoteStatus*={'Issued','Finalised'}, &lt;/STRONG&gt;&lt;STRONG&gt;Q_QUOTE_StartDate={"&amp;gt;=$(=date(vStartDate,'DD/MM/YYYY'))&amp;lt;=$(=date(vEndDate,'DD/MM/YYYY'))"}&amp;gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;and then use this like this&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG&gt;Count(Distinct $(vVar) CaseID)&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;or you might need an equal sign&lt;/P&gt;&lt;P style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;&lt;STRONG style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 13px;"&gt;Count(Distinct $(=vVar) CaseID)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 15:12:42 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320340#M28491</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-31T15:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Selection Criteria as a Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320341#M28492</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Brilliant - many thanks - and super quick too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It was the first one by the way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 15:22:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320341#M28492</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-31T15:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Setting Selection Criteria as a Variable</title>
      <link>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320342#M28493</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Variables often confuses me... its a hit and trial when it comes to variable for me...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2017 15:28:24 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Setting-Selection-Criteria-as-a-Variable/m-p/1320342#M28493</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-31T15:28:24Z</dc:date>
    </item>
  </channel>
</rss>

