<?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: Simple If condition not working at script level in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809692#M285774</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;try using date(date#([your date],'MM/DD/YYYY')).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 19 Jan 2015 05:30:48 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-01-19T05:30:48Z</dc:date>
    <item>
      <title>Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809689#M285771</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 gross up with tax rate as below at script load. However, the rate that get applied is first rate that I have given which is 1.2571 and else condition rate of 1.2459 does not get calculated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get 1.2571 for the total period.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If([Business Date]&amp;lt;='12/31/2014',([Pkg Revenue]*1.2571),([Pkg Revenue]*1.2459)) as [Pkg Revenue]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.63636302948px;"&gt;I'm having 11.2 SR7 in the server. &lt;/SPAN&gt;Any Idea....?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Senarath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 05:20:53 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809689#M285771</guid>
      <dc:creator>senarath</dc:creator>
      <dc:date>2015-01-19T05:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809690#M285772</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;Then the if condition is always satisfied. Do you have any dates after Dec 31? If so, then check your date formatting, as either [Business Date] or '12/31/2014' are not being interpreted correctly as a date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;P&gt;Jonathan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 05:25:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809690#M285772</guid>
      <dc:creator>jonathandienst</dc:creator>
      <dc:date>2015-01-19T05:25:54Z</dc:date>
    </item>
    <item>
      <title>Re: Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809691#M285773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try formatting date in Date#('12/31/2014', 'MM/DD/YYYY') in the condition instead of directing using it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 05:29:59 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809691#M285773</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-19T05:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809692#M285774</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;try using date(date#([your date],'MM/DD/YYYY')).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 05:30:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809692#M285774</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-01-19T05:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809693#M285775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Senarath,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check whether dates after the 12/31/2014 is so then only the condition will get satisfied.&lt;/P&gt;&lt;P&gt;As Jonathan said check for the date format and covert both the date to same format like:&lt;/P&gt;&lt;P&gt;Date([Business Date],'MM/DD/YYYY')&amp;lt;='12/31/2014 this should work. If not please post your app with sample data &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 05:34:57 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809693#M285775</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2015-01-19T05:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809694#M285776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I applied date format also and did NOT work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Date#([Business Date],'MM/DD/YYYY')&amp;lt;='12/31/2014',([Pkg Revenue]*1.2571),if(Date#([Business Date],'MM/DD/YYYY')&amp;gt;='01/01/2015',([Pkg Revenue]*1.2459))) as [Pkg Revenue],&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIRST Rate get applied to all the period and not the second.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls find attached the excel data file FYI...!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 05:59:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809694#M285776</guid>
      <dc:creator>senarath</dc:creator>
      <dc:date>2015-01-19T05:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809695#M285777</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;Please find the attachment for the solution .&lt;/P&gt;&lt;P&gt;The Expression is&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If(Date([Business Date],'MM/DD/YYYY')&amp;lt;='12/31/2014',([Pkg Revenue]*1.2571),if(Date([Business Date],'MM/DD/YYYY')&amp;gt;='01/01/2015',([Pkg Revenue]*1.2459))) as [New Pkg Revenue]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 06:09:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809695#M285777</guid>
      <dc:creator>avinashelite</dc:creator>
      <dc:date>2015-01-19T06:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809696#M285778</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;Try like this&lt;/P&gt;&lt;P&gt;Date#() will give you the date in numeric format.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If(Date([Business Date],'MM/DD/YYYY')&amp;lt;='12/31/2014',([Pkg Revenue]*1.2571),if(Date([Business Date],'MM/DD/YYYY')&amp;gt;='01/01/2015',([Pkg Revenue]*1.2459))) as [Pkg Revenue],&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;OR&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;If(Date([Business Date],'MM/DD/YYYY')&amp;lt;=MakeDate(2014, 12, 31),([Pkg Revenue]*1.2571),if(Date([Business Date],'MM/DD/YYYY')&amp;gt;=MakeDate(2015, 1,1),([Pkg Revenue]*1.2459))) as [Pkg Revenue],&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Hope this help you.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Jagan.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 06:28:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809696#M285778</guid>
      <dc:creator>jagan</dc:creator>
      <dc:date>2015-01-19T06:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Simple If condition not working at script level</title>
      <link>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809697#M285779</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the issue. All the replies that you guys had posted apply correctly. However, I just verified that environmental variables in Main page is as default as I had customized date format as DD/MM/YYYY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I changed that to default, problem was solved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks you guys.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Senarath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Jan 2015 07:07:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Simple-If-condition-not-working-at-script-level/m-p/809697#M285779</guid>
      <dc:creator>senarath</dc:creator>
      <dc:date>2015-01-19T07:07:54Z</dc:date>
    </item>
  </channel>
</rss>

