<?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: Variables/SA in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392346#M1160580</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The format is in principle &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;irrelevant&lt;/STRONG&gt;&lt;/SPAN&gt;. The comparison is made on the number behind. (It's a dual so the field has both a numeric and a string representation.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I would define the variable as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Let vCurrMonth = Num(MonthStart(today()));&lt;/P&gt;&lt;P&gt;and use this integer in a comparison with MonthYear (that also should be created using MonthStart).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 Nov 2012 11:29:59 GMT</pubDate>
    <dc:creator>hic</dc:creator>
    <dc:date>2012-11-30T11:29:59Z</dc:date>
    <item>
      <title>Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392339#M1160573</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'm trying to get a count for the current and previous month using set analysis with a variable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the current month-year:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;date(today(),'MMM-YY')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set analysis formula:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;MonthYear = {$(vcurrmonth)}&amp;gt;}dc_code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as I am aware the MonthYear and current month variable are in the same format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone tell me what I am doing wrong?&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, 29 Nov 2012 16:53:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392339#M1160573</guid>
      <dc:creator />
      <dc:date>2012-11-29T16:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392340#M1160574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try enclosing your variable in single quotes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;count({$&amp;lt;MonthYear = {'$(vcurrmonth)'}&amp;gt;}dc_code)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 16:57:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392340#M1160574</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-11-29T16:57:26Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392341#M1160575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;No luck I'm afraid...although I now get a 0 instead of a null...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 17:00:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392341#M1160575</guid>
      <dc:creator />
      <dc:date>2012-11-29T17:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392342#M1160576</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; Did u check the format? Its MMM-YY&amp;nbsp; or MMM-YYYY?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MonthYear format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After that &lt;/P&gt;&lt;P&gt;count({$&amp;lt;MonthYear = {'$(vcurrmonth)'}&amp;gt;}dc_code)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 17:09:34 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392342#M1160576</guid>
      <dc:creator>MayilVahanan</dc:creator>
      <dc:date>2012-11-29T17:09:34Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392343#M1160577</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;Yes I'm sure the format is the same as when I use an IF statement to put a flag on records for the current and previous months that works ok.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 17:14:55 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392343#M1160577</guid>
      <dc:creator />
      <dc:date>2012-11-29T17:14:55Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392344#M1160578</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you trying to use the set expression in a chart with a date dimension (e.g. YearMonth)? For a comparison of counts for different time periods?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then try&lt;/P&gt;&lt;P&gt;count(TOTAL {$&amp;lt;MonthYear = {'$(vcurrmonth)'}&amp;gt;}dc_code)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Nov 2012 17:19:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392344#M1160578</guid>
      <dc:creator>swuehl</dc:creator>
      <dc:date>2012-11-29T17:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392345#M1160579</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently I'm not using a dimension - however I tried your suggestion but it still doesn't work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The variable is an expression, will that make a difference?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2012 10:29:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392345#M1160579</guid>
      <dc:creator />
      <dc:date>2012-11-30T10:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392346#M1160580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The format is in principle &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;irrelevant&lt;/STRONG&gt;&lt;/SPAN&gt;. The comparison is made on the number behind. (It's a dual so the field has both a numeric and a string representation.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I would define the variable as&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Let vCurrMonth = Num(MonthStart(today()));&lt;/P&gt;&lt;P&gt;and use this integer in a comparison with MonthYear (that also should be created using MonthStart).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HIC&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2012 11:29:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392346#M1160580</guid>
      <dc:creator>hic</dc:creator>
      <dc:date>2012-11-30T11:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392347#M1160581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check both field format then Try the below syntex&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=count({$&amp;lt;MonthYear = {$(=vcurrmonth)}&amp;gt;}dc_code)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2012 11:58:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392347#M1160581</guid>
      <dc:creator>kumarnatarajan</dc:creator>
      <dc:date>2012-11-30T11:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392348#M1160582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Henric&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The set analysis doesn't seem to accept using num inside the expression (for the monthyear), is this something that needs to be done in the script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 Nov 2012 12:13:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392348#M1160582</guid>
      <dc:creator />
      <dc:date>2012-11-30T12:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Variables/SA</title>
      <link>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392349#M1160583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I resolved this - by removing the calendar dates from the set analysis which were skewing the figures.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Dec 2012 15:54:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Variables-SA/m-p/392349#M1160583</guid>
      <dc:creator />
      <dc:date>2012-12-03T15:54:49Z</dc:date>
    </item>
  </channel>
</rss>

