<?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 Variable Like A Regular Field in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224261#M621930</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this set of sample data there was one customer lost (the record with Customer ID = 1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Mar 2017 16:20:22 GMT</pubDate>
    <dc:creator />
    <dc:date>2017-03-16T16:20:22Z</dc:date>
    <item>
      <title>Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224256#M621925</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;Is it possible to use a variable in the same way that you'd use a field in an expression. I basically need to calculate a total in a text box that counts the number of records that have a specific variable value, but this can't be a field that I create in my script because it is based on the current selection - it can't be static. This is what I have in my text box expression and it's not working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count(distinct if($(c_status) = -1, [Customer Number]))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there anything I could do to make this work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:47:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224256#M621925</guid>
      <dc:creator />
      <dc:date>2017-03-16T15:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224257#M621926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would you be able to share a sample app where we can see what exactly are you trying to do? Difficult to understand by looking at just the description&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 15:51:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224257#M621926</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-16T15:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224258#M621927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;At least post the definition of your variable c_status, and if possible some sample lines of records.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:09:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224258#M621927</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-03-16T16:09:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224259#M621928</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to get the text box called "Customers Lost" to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to be able to select any 2 Production Dates in my actual document and have this change based on that&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:15:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224259#M621928</guid>
      <dc:creator />
      <dc:date>2017-03-16T16:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224260#M621929</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are nesting aggregations, you will most likely need to use Aggr() function.... What is the expected output from the sample shared?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:18:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224260#M621929</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-16T16:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224261#M621930</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For this set of sample data there was one customer lost (the record with Customer ID = 1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:20:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224261#M621930</guid>
      <dc:creator />
      <dc:date>2017-03-16T16:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224262#M621931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May be try this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT {&amp;lt;[Customer ID] = P({&amp;lt;[Production Date] = {"$(=Min([Production Date]))"}&amp;gt;})-P({&amp;lt;[Production Date] = {"$(=Max([Production Date]))"}&amp;gt;})&amp;gt;} [Customer ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:22:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224262#M621931</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-16T16:22:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224263#M621932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Customers left&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT {&amp;lt;[Customer ID] = P({&amp;lt;[Production Date] = {"$(=Date(Min([Production Date])))"}&amp;gt;})-P({&amp;lt;[Production Date] = {"$(=Date(Max([Production Date])))"}&amp;gt;})&amp;gt;} [Customer ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New Customers&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT {&amp;lt;[Customer ID] = P({&amp;lt;[Production Date] = {"$(=Date(Max([Production Date])))"}&amp;gt;})-P({&amp;lt;[Production Date] = {"$(=Date(Min([Production Date])))"}&amp;gt;})&amp;gt;} [Customer ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Retained Customers&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;=Count(DISTINCT {&amp;lt;[Customer ID] = P({&amp;lt;[Production Date] = {"$(=Date(Max([Production Date])))"}&amp;gt;})*P({&amp;lt;[Production Date] = {"$(=Date(Min([Production Date])))"}&amp;gt;})&amp;gt;} [Customer ID])&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:26:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224263#M621932</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-16T16:26:32Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224264#M621933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To help you answer your original question:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Variables won't hold something dimensional, like a table or field, they hold a single value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use variables to be expanded to field names, though. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Learn more about variables, the importance of the context where they are evaluated in and what a 'dollar sign expansion' is in&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.qlik.com/qlik-blogpost/3406"&gt;The Magic of Variables&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(and the blog post that are linked at the bottom).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 16:33:50 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224264#M621933</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-03-16T16:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224265#M621934</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works, thank you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One more question - how would I create a chart that only includes customers left? Would I need to somehow get these expressions in a dimension and suppress when null?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 17:00:03 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224265#M621934</guid>
      <dc:creator />
      <dc:date>2017-03-16T17:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224266#M621935</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use the same set analysis in your expression for this particular chart and you should only see those customers which left&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d;"&gt;{&amp;lt;[Customer ID] = P({&amp;lt;[Production Date] = {"$(=Date(Min([Production Date])))"}&amp;gt;})-P({&amp;lt;[Production Date] = {"$(=Date(Max([Production Date])))"}&amp;gt;})&amp;gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 17:02:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224266#M621935</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-16T17:02:49Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224267#M621936</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Perfect, thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Mar 2017 17:07:51 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224267#M621936</guid>
      <dc:creator />
      <dc:date>2017-03-16T17:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224268#M621937</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I tried using these expressions in a straight table and I am running into an issue. The dimension I am using in the chart is 'Branch'&amp;nbsp; - it is possible for one 'Customer ID' to belong to more than one branch. When I have no selections made I get different counts using these expressions than when I select a specific branch. I am assuming that this has something to do with the use of distinct. For example id 'Customer ID' = 2 belongs to branch 23 and 25, so which branch will it be counted in on my straight table? Let me know if a sample document would make this easier.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 13:29:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224268#M621937</guid>
      <dc:creator />
      <dc:date>2017-03-17T13:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224269#M621938</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A sample would def. make it easier. Also, it would be helpful what do you desire to see in your table based on few different selections&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 13:44:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224269#M621938</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2017-03-17T13:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224270#M621939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If the customer can belong to different branches, it will count towards each branch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But the current set analysis might imply that the customer will not change branch between selected dates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you need to check existence of customer specific to a branch, it would be best to create a key in the load script made of branch and customer, and use this instead of customer id in your set expression&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOAD&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Branch,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [Customer ID],&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG&gt; AutonumberHash128(Branch, [Customer ID]) as BranchCustomerKey,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ,,,,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Count( DISTINCT &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 13px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; color: #3d3d3d; background-color: #f2f2f2;"&gt;{&amp;lt;[&lt;SPAN style="font-size: 13.3333px;"&gt;BranchCustomerKey&lt;/SPAN&gt;] = P({&amp;lt;[Production Date] = {"$(=Date(Min([Production Date])))"}&amp;gt;})-P({&amp;lt;[Production Date] = {"$(=Date(Max([Production Date])))"}&amp;gt;})&amp;gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #3d3d3d; font-size: 13.3333px; background-color: #f2f2f2; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;BranchCustomerKey)&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 13:54:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224270#M621939</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-03-17T13:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224271#M621940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works, thank you. Will I need to make a specific key for every chart dimension that I choose to use with this expression? For example - if I'd like to use plan number as the dimension since it is possible for the 'Customer ID' to have switched plans over the span of selected dates.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 14:55:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224271#M621940</guid>
      <dc:creator />
      <dc:date>2017-03-17T14:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Using Variable Like A Regular Field</title>
      <link>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224272#M621941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You probably need to create a key for any independent combination of dimensions. If you are coping with some kind of hierarchies, like customer relation to City, Country, Region, it might be sufficient to create the key for the most granular attribute combination.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:01:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Using-Variable-Like-A-Regular-Field/m-p/1224272#M621941</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2017-03-17T15:01:13Z</dc:date>
    </item>
  </channel>
</rss>

