<?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 Format question in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Format-question/m-p/272234#M709539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;you can make vPeriod_Test = date(max(PERIOD),'MM/DD/YYYY')&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;vPeriod_Test = text(date(max(PERIOD),'MM/DD/YYYY'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and to compare them, you can use: &lt;/P&gt;&lt;P&gt;if('$(vPeriod)' = '$(vPeriod_Test)',1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn't work like this, you can try to compare them using number formats: &lt;/P&gt;&lt;P&gt;vPeriod_Test = num( date(max(PERIOD),'MM/DD/YYYY') ) &lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;if( num( date#('$(vPeriod)','MM/DD/YYYY') = $(vPeriod_Test),1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Jul 2011 14:11:25 GMT</pubDate>
    <dc:creator>erichshiino</dc:creator>
    <dc:date>2011-07-11T14:11:25Z</dc:date>
    <item>
      <title>Format question</title>
      <link>https://community.qlik.com/t5/QlikView/Format-question/m-p/272233#M709538</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have two variables vPeriod and vPeriod_Test&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vPeriod = '07/05/2011'&amp;nbsp; (This can be any random date; I'm just taking July 5th as an example)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to replicate the same format in vPeriod_Test using a formula.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vPeriod_Test = chr(39)&amp;amp;date(max(PERIOD),'MM/DD/YYYY')&amp;amp;chr(39)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, the following does not seem to work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if($(vPeriod) = $(vPeriod_Test),1,0), I'm getting a 0 telling me that the two variables are not in the same format. How can I get these two in the same format?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 13:57:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Format-question/m-p/272233#M709538</guid>
      <dc:creator />
      <dc:date>2011-07-11T13:57:06Z</dc:date>
    </item>
    <item>
      <title>Format question</title>
      <link>https://community.qlik.com/t5/QlikView/Format-question/m-p/272234#M709539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;you can make vPeriod_Test = date(max(PERIOD),'MM/DD/YYYY')&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;vPeriod_Test = text(date(max(PERIOD),'MM/DD/YYYY'))&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and to compare them, you can use: &lt;/P&gt;&lt;P&gt;if('$(vPeriod)' = '$(vPeriod_Test)',1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn't work like this, you can try to compare them using number formats: &lt;/P&gt;&lt;P&gt;vPeriod_Test = num( date(max(PERIOD),'MM/DD/YYYY') ) &lt;/P&gt;&lt;P&gt;and &lt;/P&gt;&lt;P&gt;if( num( date#('$(vPeriod)','MM/DD/YYYY') = $(vPeriod_Test),1,0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 14:11:25 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Format-question/m-p/272234#M709539</guid>
      <dc:creator>erichshiino</dc:creator>
      <dc:date>2011-07-11T14:11:25Z</dc:date>
    </item>
    <item>
      <title>Format question</title>
      <link>https://community.qlik.com/t5/QlikView/Format-question/m-p/272235#M709540</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this which seems to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let vPeriod = '07/05/2011';&lt;/P&gt;&lt;P&gt;Let vPeriod_Test1 = date(vPeriod,'MM/DD/YYYY');&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 14:19:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Format-question/m-p/272235#M709540</guid>
      <dc:creator>nagaiank</dc:creator>
      <dc:date>2011-07-11T14:19:32Z</dc:date>
    </item>
    <item>
      <title>Format question</title>
      <link>https://community.qlik.com/t5/QlikView/Format-question/m-p/272236#M709541</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Eric for the prompt reply. It worked. Let me provide some more context on my problem. I have a chart that sum sales on the most recent period. &lt;/P&gt;&lt;P&gt;Currently, vPeriod is defined as vPeriod = '07/05/2011'. So my chart utilizes this variable in the following formula:&lt;/P&gt;&lt;P&gt;Sum (PERIOD = {$(vPeriod)}&amp;gt;} Sales).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem is, everytime I refresh the source data I have to manually update the Period. I'm trying to write a formula on the PERIOD variable such that it ONLY takes the max PERIOD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note PERIOD field is in 'MM/DD/YYYY' format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Vishal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Jul 2011 14:47:00 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Format-question/m-p/272236#M709541</guid>
      <dc:creator />
      <dc:date>2011-07-11T14:47:00Z</dc:date>
    </item>
  </channel>
</rss>

