<?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: If Condition not working in Expression in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1526103#M438424</link>
    <description>so am i right?&lt;BR /&gt;what you want to compare is time(EndTime) and time(outtime), right?&lt;BR /&gt;if yes, please use below expression firstly,&lt;BR /&gt;=if(Time(EndTime) &amp;gt; Time(outtime),1,0)&lt;BR /&gt;if you can get "1", then try to change "late time 2"&lt;BR /&gt;Aiolos Zhao</description>
    <pubDate>Fri, 04 Jan 2019 01:51:13 GMT</pubDate>
    <dc:creator>uacg0009</dc:creator>
    <dc:date>2019-01-04T01:51:13Z</dc:date>
    <item>
      <title>If Condition not working in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1525463#M438368</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below expression is not working as expected because the condition inisde if statement is never returning true value in expression of a chart, but the same condition is working fine when it was applied in a dimension. kindly assist&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expression:&amp;nbsp;=if(Time(Timestamp#( Date(num(%ShiftDate)+1,'DD/MM/YYYY') &amp;amp;' '&amp;amp;EndTime,'DD/MM/YYYY hh.mm TT')) &amp;gt; Time(outtime),&lt;BR /&gt;[Late Time 2],'0')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt;&amp;nbsp;&lt;SPAN&gt;[Late Time 2] =&amp;nbsp;Time(Only({&amp;lt;%ShiftDate={'&amp;gt;=$(=Date(vStart))&amp;lt;=$(=Date(vEnd))'},MonthYear&amp;gt;}&lt;BR /&gt;(Timestamp#(Date(num(%ShiftDate)-1,)&amp;amp;' '&amp;amp;EndTime,'DD/MM/YYYY hh.mm TT')-outtime)),'hh:mm')&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 04:51:54 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1525463#M438368</guid>
      <dc:creator>sivakumar1994</dc:creator>
      <dc:date>2024-11-16T04:51:54Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition not working in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1525464#M438369</link>
      <description>Would you be able to share a sample so that we can see the issue?</description>
      <pubDate>Wed, 02 Jan 2019 14:20:41 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1525464#M438369</guid>
      <dc:creator>sunny_talwar</dc:creator>
      <dc:date>2019-01-02T14:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition not working in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1525679#M438389</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Firstly I want to say that if you only need to compare the "time", it seems like that the "%ShiftDate" is useless.&lt;/P&gt;&lt;P&gt;And what's your dimension in this table, and your data model also affect the result.&lt;/P&gt;&lt;P&gt;It's better to share a small sample, so we can find the real reason.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Aiolos Zhao&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 07:06:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1525679#M438389</guid>
      <dc:creator>uacg0009</dc:creator>
      <dc:date>2019-01-03T07:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition not working in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1525834#M438403</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since data is confidential i wont be able to share the data, The dimension includes %shiftdate (DD/MM/YYYY) and shift start date (Example: 10 AM) , shift end time (4 PM).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jan 2019 13:20:12 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1525834#M438403</guid>
      <dc:creator>sivakumar1994</dc:creator>
      <dc:date>2019-01-03T13:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition not working in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1526103#M438424</link>
      <description>so am i right?&lt;BR /&gt;what you want to compare is time(EndTime) and time(outtime), right?&lt;BR /&gt;if yes, please use below expression firstly,&lt;BR /&gt;=if(Time(EndTime) &amp;gt; Time(outtime),1,0)&lt;BR /&gt;if you can get "1", then try to change "late time 2"&lt;BR /&gt;Aiolos Zhao</description>
      <pubDate>Fri, 04 Jan 2019 01:51:13 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1526103#M438424</guid>
      <dc:creator>uacg0009</dc:creator>
      <dc:date>2019-01-04T01:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition not working in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1526568#M438470</link>
      <description>&lt;P&gt;Partially correct.&lt;/P&gt;&lt;P&gt;There are possible scenario where shift end time is 2 am or 3 am (Next day time stamp) , hence&amp;nbsp;&lt;SPAN&gt;=if(Time(EndTime) &amp;gt; Time(outtime),1,0) doesn't meet the expectation. I tried with below code in expression to identify late night shift time , but that doesn't work expected.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FYI, end time value is like '2:00 AM' whereas outime is swipe out timestamp value ('05-01-2018 01:06 AM') , so i am trying to add shiftdate ('04-01-2018') + 1 for shift end time containing '*Am*'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if( Wildcard(EndTime,'*AM*'),&lt;/P&gt;&lt;P&gt;if(Time(Timestamp#( Date(num(%ShiftDate)+1,'DD/MM/YYYY') &amp;amp;' '&amp;amp;EndTime,'DD/MM/YYYY hh.mm TT')) &amp;gt; Time(outtime),&lt;BR /&gt;[Late Time 2],'0'),0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt;&amp;nbsp;&lt;SPAN&gt;[Late Time 2] =&amp;nbsp;Time(Only({&amp;lt;%ShiftDate={'&amp;gt;=$(=Date(vStart))&amp;lt;=$(=Date(vEnd))'},MonthYear&amp;gt;}&lt;BR /&gt;(Timestamp#(Date(num(%ShiftDate)-1,)&amp;amp;' '&amp;amp;EndTime,'DD/MM/YYYY hh.mm TT')-outtime)),'hh:mm')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The above logic is not working. Kindly assist.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 18:32:32 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1526568#M438470</guid>
      <dc:creator>sivakumar1994</dc:creator>
      <dc:date>2019-01-04T18:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: If Condition not working in Expression</title>
      <link>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1526772#M438484</link>
      <description>Hi,&lt;BR /&gt;I think if you want to compare these 2 "date", then you can not use the time() function, it will be wrong.&lt;BR /&gt;You need to compare it directly, like:&lt;BR /&gt;num(%ShiftDate) + 1 + EndTime &amp;gt; outtime&lt;BR /&gt;But there is a problem you need to test, because I don't have sample data, so I can't try.&lt;BR /&gt;You can select one column data, then you need to make sure that&lt;BR /&gt;num(%ShiftDate) + 1 + EndTime can get a value, but not null&lt;BR /&gt;I think num(%ShiftDate) + 1 is ok, the problem is when you + EndTime, I'm not sure it can get value or not. if not you need to change your EndTime to num, then add, I think you will get the correct result.&lt;BR /&gt;Please try.&lt;BR /&gt;Aiolos Zhao&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Jan 2019 02:26:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/If-Condition-not-working-in-Expression/m-p/1526772#M438484</guid>
      <dc:creator>uacg0009</dc:creator>
      <dc:date>2019-01-07T02:26:49Z</dc:date>
    </item>
  </channel>
</rss>

