<?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: Using a variable as dimension in set analysis in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111222#M367532</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I haven't a solution for you but this is a simplification to your clause since if &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;$(vActuals)&amp;lt;FACT.THRESHOLD_TARGET is false then &lt;SPAN style="font-size: 13.3333px;"&gt;$(vActuals)&amp;gt;= FACT.THRESHOLD_TARGET is true and you don't need to test it's truth.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vFlag =&lt;/P&gt;&lt;P&gt;if(FACT.TARGET_VARIANCE = 'U',&lt;/P&gt;&lt;P&gt;if($(vActuals)&amp;lt;FACT.THRESHOLD_TARGET, 'Bad',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(&lt;SPAN style="text-decoration: line-through;"&gt;$(vActuals)&amp;gt;= FACT.THRESHOLD_TARGET and&lt;/SPAN&gt; $(vActuals)&amp;lt; $(vTarget), 'OK', 'Good')),&lt;/P&gt;&lt;P&gt;if($(vActuals)&amp;lt;FACT.TARGET, 'Good',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(vActuals)&amp;lt;= FACT.THRESHOLD_TARGET and $(vActuals)&amp;gt; $(vTarget), 'OK', 'Bad')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might make it a little easier to work on.&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;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 15 Aug 2016 15:58:29 GMT</pubDate>
    <dc:creator>effinty2112</dc:creator>
    <dc:date>2016-08-15T15:58:29Z</dc:date>
    <item>
      <title>Using a variable as dimension in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111219#M367529</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 have a flag that I've created using a variable, which is calculated using other variables.&amp;nbsp; I'd like to use this flag variable in my set analysis to get a count of metrics that are 'Good' but I'm having trouble getting it to work.&amp;nbsp; Below are the variables I'm using to create the flag.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vFlag = &lt;/P&gt;&lt;P&gt;if(FACT.TARGET_VARIANCE = 'U',&lt;/P&gt;&lt;P&gt;if($(vActuals)&amp;lt;FACT.THRESHOLD_TARGET, 'Bad', &lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(vActuals)&amp;gt;= FACT.THRESHOLD_TARGET and $(vActuals)&amp;lt; $(vTarget), 'OK', 'Good')),&lt;/P&gt;&lt;P&gt;if($(vActuals)&amp;lt;FACT.TARGET, 'Good', &lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(vActuals)&amp;lt;= FACT.THRESHOLD_TARGET and $(vActuals)&amp;gt; $(vTarget), 'OK', 'Bad')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vActuals = &lt;/P&gt;&lt;P&gt;if(FACT.MASK_DISPLAY = '#.##%', num(sum(FACT.NUMERATOR)/sum(FACT.DENOMINATOR), '#,##0.00%'),&lt;/P&gt;&lt;P&gt;Median(FACT.MEDIAN))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vTarget = &lt;/P&gt;&lt;P&gt;if(FACT.MASK_DISPLAY = '#.##%', num(FACT.TARGET, '0.00%'),&lt;/P&gt;&lt;P&gt;FACT.TARGET)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I'm trying to get my set analysis to do is say &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;count({&amp;lt;$(vFlag) = {'Bad'}&amp;gt;} METRIC.METRIC_DESCRIPTION)&amp;nbsp; but I can't get it to work. I've tried calculating the variables in my script, but that's not working either.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would anyone have any suggetions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 15:36:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111219#M367529</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-15T15:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable as dimension in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111220#M367530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Variables that contain expressions cannot work on the left hand side of the set expression. You might be able to use Aggr() or search string within set analysis to make this to work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 15:40:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111220#M367530</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-08-15T15:40:07Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable as dimension in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111221#M367531</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply Sunny!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a bit confused with your solution. Can you elaborate on what you mean by using Aggr() or a search string in set analysis using the flag?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 15:45:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111221#M367531</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-15T15:45:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable as dimension in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111222#M367532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi David,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I haven't a solution for you but this is a simplification to your clause since if &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;$(vActuals)&amp;lt;FACT.THRESHOLD_TARGET is false then &lt;SPAN style="font-size: 13.3333px;"&gt;$(vActuals)&amp;gt;= FACT.THRESHOLD_TARGET is true and you don't need to test it's truth.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vFlag =&lt;/P&gt;&lt;P&gt;if(FACT.TARGET_VARIANCE = 'U',&lt;/P&gt;&lt;P&gt;if($(vActuals)&amp;lt;FACT.THRESHOLD_TARGET, 'Bad',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if(&lt;SPAN style="text-decoration: line-through;"&gt;$(vActuals)&amp;gt;= FACT.THRESHOLD_TARGET and&lt;/SPAN&gt; $(vActuals)&amp;lt; $(vTarget), 'OK', 'Good')),&lt;/P&gt;&lt;P&gt;if($(vActuals)&amp;lt;FACT.TARGET, 'Good',&lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(vActuals)&amp;lt;= FACT.THRESHOLD_TARGET and $(vActuals)&amp;gt; $(vTarget), 'OK', 'Bad')))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It might make it a little easier to work on.&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;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 15:58:29 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111222#M367532</guid>
      <dc:creator>effinty2112</dc:creator>
      <dc:date>2016-08-15T15:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable as dimension in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111223#M367533</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Set modifiers cannot be any expression,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It should be a field name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you can post a sample, we can look into other solutions ...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Aug 2016 16:07:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111223#M367533</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-08-15T16:07:01Z</dc:date>
    </item>
    <item>
      <title>Re: Using a variable as dimension in set analysis</title>
      <link>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111224#M367534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello David, Try converting the output to text. May help. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vFlag = Text(&lt;/P&gt;&lt;P&gt;if(FACT.TARGET_VARIANCE = 'U',&lt;/P&gt;&lt;P&gt;if($(vActuals)&amp;lt;FACT.THRESHOLD_TARGET, 'Bad', &lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(vActuals)&amp;gt;= FACT.THRESHOLD_TARGET and $(vActuals)&amp;lt; $(vTarget), 'OK', 'Good')),&lt;/P&gt;&lt;P&gt;if($(vActuals)&amp;lt;FACT.TARGET, 'Good', &lt;/P&gt;&lt;P&gt;&amp;nbsp; if($(vActuals)&amp;lt;= FACT.THRESHOLD_TARGET and $(vActuals)&amp;gt; $(vTarget), 'OK', 'Bad')))&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;And then&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;count({&amp;lt;$(vFlag) = {'Bad'}&amp;gt;} METRIC.METRIC_DESCRIPTION) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hope this works!Please update us&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Thank you&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 May 2018 08:19:07 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-a-variable-as-dimension-in-set-analysis/m-p/1111224#M367534</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-05-10T08:19:07Z</dc:date>
    </item>
  </channel>
</rss>

