<?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: creating a field with values as expressions in script in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127748#M371053</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Divya,&lt;/P&gt;&lt;P&gt;Yes, you can use variables like a function using parameters. $1 is your parameter, and you pass the values like this $(YourVar(ParameterValue)). If your parameter is a string or a formated date, use single quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Sep 2016 06:06:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-09-05T06:06:39Z</dc:date>
    <item>
      <title>creating a field with values as expressions in script</title>
      <link>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127743#M371048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently, I have a drill-down chart with Region-&amp;gt;City and I have 5 expressions say A,B,C,D &amp;amp; E. I see 5 bars(A,B,C,D,E) when on "Region" or when I drill down to "City". But B,C,D &amp;amp; E are subset of A. So, I want to see only 1 bar (A) when in "Region" or "City" and I would like to see the subsets (B,C,D,E)&amp;nbsp; only when I make a selection in City.&lt;/P&gt;&lt;P&gt;So, my idea is that I have to create a new level "Values" on the script side and define a hierarchy (Region-&amp;gt; City-&amp;gt; Values). And this "Values" contains B,C,D &amp;amp; E.&lt;/P&gt;&lt;P&gt;Could someone help me in creating this, the script side of it?&lt;/P&gt;&lt;P&gt;The expression that I use now for A,B,C,D,E is something like this:&lt;/P&gt;&lt;P&gt;=COUNT({&amp;lt;Date=, Year=, Month=, Day= &amp;gt;} DISTINCT IF((EVT_RSTATUS = 'R' or EVT_RSTATUS = 'Q') and EVT_SCHEDEND &amp;lt; today() and EVT_STATUS &amp;lt;&amp;gt; 'S'&lt;BR /&gt;and EVT_JOBTYPE='PM' &lt;/P&gt;&lt;P&gt;,EVT_CODE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EVT_JOBTYPE is different for A,B,C,D &amp;amp; E&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 06:38:20 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127743#M371048</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2016-09-01T06:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: creating a field with values as expressions in script</title>
      <link>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127744#M371049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the reason for creating a 5 expressions. Are these different fields within a single table? May be you want to transpose your data into rows instead of having them as separate columns using &lt;A href="https://community.qlik.com/qlik-blogpost/3628"&gt;The Crosstable Load&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 11:10:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127744#M371049</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2016-09-01T11:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: creating a field with values as expressions in script</title>
      <link>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127745#M371050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sunny,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason why there are 5 expressions is that they have different values for EVT_JOBTYPE in the expression I've provided. eg: A: EVT_JOBYTYPE='PM'&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B: EVT_JOBYTYPE='OT'&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp; so on.&lt;/P&gt;&lt;P&gt;I don't think changing the rows into columns is a good idea, because it is a huge database and if I make that change then it would impact the many expressions I've used on the Layout.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 11:55:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127745#M371050</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2016-09-01T11:55:10Z</dc:date>
    </item>
    <item>
      <title>Re: creating a field with values as expressions in script</title>
      <link>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127746#M371051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Divya,&lt;/P&gt;&lt;P&gt;You dont need to create 5 expressions.&lt;/P&gt;&lt;P&gt;Create one variable with this:&lt;/P&gt;&lt;P&gt;YourVar content:&lt;/P&gt;&lt;P&gt;=COUNT({&amp;lt;Date=, Year=, Month=, Day= &amp;gt;} DISTINCT IF((EVT_RSTATUS = 'R' or EVT_RSTATUS = 'Q') and EVT_SCHEDEND &amp;lt; today() and EVT_STATUS &amp;lt;&amp;gt; 'S' and EVT_JOBTYPE=&lt;STRONG&gt;$1&lt;/STRONG&gt; ,EVT_CODE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you call your var:&lt;/P&gt;&lt;P&gt;$(YourVar('PM'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you can simplify your expression:&lt;/P&gt;&lt;P&gt;=COUNT({&amp;lt;Date=, Year=, Month=, Day=,EVT_RSTATUS = {'R','Q'},EVT_STATUS=-{'S'},EVT_JOBTYPE={&lt;STRONG&gt;$1&lt;/STRONG&gt;}&amp;gt;} IF(EVT_SCHEDEND &amp;lt; today(),EVT_CODE))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, you can add more than one EVT_JOBTYPE, like this: $(YourVar('PM,OP1,OP2,OP3,...'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 13:10:43 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127746#M371051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-01T13:10:43Z</dc:date>
    </item>
    <item>
      <title>Re: creating a field with values as expressions in script</title>
      <link>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127747#M371052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Manuel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So you mean, I must create a variable&lt;/P&gt;&lt;P&gt;vVar=COUNT({&amp;lt;Date=, Year=, Month=, Day=,EVT_RSTATUS = {'R','Q'},EVT_STATUS=-{'S'},EVT_JOBTYPE={&lt;STRONG&gt;$1&lt;/STRONG&gt;}&amp;gt;} IF(EVT_SCHEDEND &amp;lt; today(),EVT_CODE))&lt;/P&gt;&lt;P&gt;and have 1 expression for B,C,D &amp;amp; E as say&lt;/P&gt;&lt;P&gt;B: $(YourVar('PM'))&lt;/P&gt;&lt;P&gt;C: $(YourVar('OT'))&lt;/P&gt;&lt;P&gt;&amp;amp; so on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;right?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Sep 2016 07:54:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127747#M371052</guid>
      <dc:creator>divya_anand</dc:creator>
      <dc:date>2016-09-02T07:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: creating a field with values as expressions in script</title>
      <link>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127748#M371053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Divya,&lt;/P&gt;&lt;P&gt;Yes, you can use variables like a function using parameters. $1 is your parameter, and you pass the values like this $(YourVar(ParameterValue)). If your parameter is a string or a formated date, use single quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Sep 2016 06:06:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/creating-a-field-with-values-as-expressions-in-script/m-p/1127748#M371053</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-09-05T06:06:39Z</dc:date>
    </item>
  </channel>
</rss>

