<?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 Problem with simple IF Statement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316768#M1201167</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 am new to QlikView and have written a simple script to extract data from spreadsheets. While doing so, I have placed a simple if statement to compare two date variables and then execute a load if the condition is satisfield. For some reason the control is not executing the load even when the condition is satisfied. I am sure I have made a silly mistake, but not sure what it is. Please can any one help?&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;let xyz = Date(FileTime('Data3.xls'));&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;let abc = today();&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;if xyz = abc then&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;I style="mso-bidi-font-style: normal;"&gt;CoverDescription:&lt;/I&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;Mapping Load&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;CoverCode,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;[Short Description]&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;FROM&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;Data3.xls&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;(biff, embedded labels, table is [Coverage-Data$]);&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Mar 2011 12:00:06 GMT</pubDate>
    <dc:creator />
    <dc:date>2011-03-29T12:00:06Z</dc:date>
    <item>
      <title>Problem with simple IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316768#M1201167</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 am new to QlikView and have written a simple script to extract data from spreadsheets. While doing so, I have placed a simple if statement to compare two date variables and then execute a load if the condition is satisfield. For some reason the control is not executing the load even when the condition is satisfied. I am sure I have made a silly mistake, but not sure what it is. Please can any one help?&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;let xyz = Date(FileTime('Data3.xls'));&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;let abc = today();&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;if xyz = abc then&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;&lt;I style="mso-bidi-font-style: normal;"&gt;CoverDescription:&lt;/I&gt;&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;Mapping Load&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;CoverCode,&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;[Short Description]&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;FROM&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;Data3.xls&lt;/P&gt;&lt;P style="margin: 0cm 0cm 0pt; line-height: normal;"&gt;(biff, embedded labels, table is [Coverage-Data$]);&lt;/P&gt;&lt;P&gt;end if&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 12:00:06 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316768#M1201167</guid>
      <dc:creator />
      <dc:date>2011-03-29T12:00:06Z</dc:date>
    </item>
    <item>
      <title>Problem with simple IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316769#M1201168</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tajdeenk,&lt;/P&gt;&lt;P&gt;Typically date/time functions are tricky in QV as sometimes the date comes out in d/m/y format, other times in UTC format (e.g. 45000).&lt;/P&gt;&lt;P&gt;Look in your variable overview in the front end if all your values come out the way they should. (Variable overview is CTRL+ATL+V). I think the today might be coming out in UTC format, hence you would need a date(today()) to format it in the3 right way.&lt;/P&gt;&lt;P&gt;Double check the values in the variable overview. The rest of your statement looks as it should be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 12:06:36 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316769#M1201168</guid>
      <dc:creator />
      <dc:date>2011-03-29T12:06:36Z</dc:date>
    </item>
    <item>
      <title>Problem with simple IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316770#M1201169</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;Hi,&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;I guess the Date function is still keeping the time information, and when you call today() you have not the time, only the date. Use the num function to do the comparaison, and trace function to see what happen, then take the floor part of tha date, something like :&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;let xyz = floor(num(Date(FileTime('your file'))));&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;trace $(xyz);&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;let abc = num(today());&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;trace $(abc);&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;if xyz = abc then&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;trace ok;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;else&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;trace not ok;&lt;/P&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;end if&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 12:12:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316770#M1201169</guid>
      <dc:creator />
      <dc:date>2011-03-29T12:12:54Z</dc:date>
    </item>
    <item>
      <title>Problem with simple IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316771#M1201170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi CheenuJanakiram,&lt;/P&gt;&lt;P&gt;Thanks for your reply. I tried your suggestion and still it doesn't work. I can also see the variables containing exactly the same values n Debug mode.&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Taj&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 12:16:01 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316771#M1201170</guid>
      <dc:creator />
      <dc:date>2011-03-29T12:16:01Z</dc:date>
    </item>
    <item>
      <title>Problem with simple IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316772#M1201171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Renaud.Charlet,&lt;/P&gt;&lt;P&gt;Thanks for your suggestion. It is now working.&lt;/P&gt;&lt;P&gt;Many Thanks,&lt;/P&gt;&lt;P&gt;Taj.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 12:24:04 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316772#M1201171</guid>
      <dc:creator />
      <dc:date>2011-03-29T12:24:04Z</dc:date>
    </item>
    <item>
      <title>Problem with simple IF Statement</title>
      <link>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316773#M1201172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin:0cm 0cm 10pt;"&gt;Your welcome, happy to help you. Just keep in mind that a date is always a number, representing the number of days since 1900, with a decimal part for the time, it's easier to use thus number representation for comparisons rather that the real date format.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Mar 2011 12:31:58 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/Problem-with-simple-IF-Statement/m-p/316773#M1201172</guid>
      <dc:creator />
      <dc:date>2011-03-29T12:31:58Z</dc:date>
    </item>
  </channel>
</rss>

