<?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: Comparing 2 dates in sense cloud in App Development</title>
    <link>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013847#M15064</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read so many posts on the IF function and never saw anything like your suggestion.&lt;/P&gt;&lt;P&gt;It works perfectly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;philippe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 25 Apr 2016 19:02:18 GMT</pubDate>
    <dc:creator />
    <dc:date>2016-04-25T19:02:18Z</dc:date>
    <item>
      <title>Comparing 2 dates in sense cloud</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013845#M15062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good afternoon,&lt;/P&gt;&lt;P&gt;Let me start by saying that I'm really new to qlik and it's also not my usual field of work so sorry if this feels trivial.&lt;/P&gt;&lt;P&gt;I'm using Qlik Sense Cloud version fyi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to count the number of orders from returning customers vs new ones.&lt;/P&gt;&lt;P&gt;For that I have a date of order (&lt;EM&gt;&lt;STRONG&gt;order_created_at&lt;/STRONG&gt;&lt;/EM&gt;) and a date of account creation for each customer (&lt;EM&gt;&lt;STRONG&gt;account_created_at&lt;/STRONG&gt;&lt;/EM&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate the KPI number of orders, I basically count the order this way&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;count (distinct order_id)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To calculate the KPI new customers, I would want to do exactly the same only if the dates are matching.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;if ( date(order_created_at) = date (account_created_at), then count (distinct order_id))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This tells me there is an error so I tried also the following:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;EM&gt;&lt;STRONG&gt;if ( $(order_created_at) = $(account_created_at), then count (distinct order_id))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;There is no longer an error but it doesn't count anything as if the condition was never meant.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Trying to read resources I'am a bit lost on how to proceed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;I tried to use tables and variables to find my way around but without success so far.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;If anyone understands what I'm trying to achieve and have a solution it would be most welcomed.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;Many thanks&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;RegnierP&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 11:49:11 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013845#M15062</guid>
      <dc:creator />
      <dc:date>2016-04-25T11:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 dates in sense cloud</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013846#M15063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Make sure &lt;SPAN style="font-size: 13.3333px;"&gt;order_created_at and account_created_at are real date fields and not text values and then t&lt;/SPAN&gt;ry this expression:&lt;/P&gt;&lt;P&gt;count (distinct if( order_created_at=account_created_at, order_id))&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 18:16:02 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013846#M15063</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-04-25T18:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 dates in sense cloud</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013847#M15064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gysbert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I read so many posts on the IF function and never saw anything like your suggestion.&lt;/P&gt;&lt;P&gt;It works perfectly!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;philippe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 25 Apr 2016 19:02:18 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013847#M15064</guid>
      <dc:creator />
      <dc:date>2016-04-25T19:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing 2 dates in sense cloud</title>
      <link>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013848#M15065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great. Glad to hear it solved your problem. Would you mind marking this discussion as answered?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2016 06:37:46 GMT</pubDate>
      <guid>https://community.qlik.com/t5/App-Development/Comparing-2-dates-in-sense-cloud/m-p/1013848#M15065</guid>
      <dc:creator>Gysbert_Wassenaar</dc:creator>
      <dc:date>2016-04-26T06:37:46Z</dc:date>
    </item>
  </channel>
</rss>

