3 Replies Latest reply: Apr 26, 2016 2:37 AM by Gysbert Wassenaar RSS

    Comparing 2 dates in sense cloud

    philippe regnier

      Good afternoon,

      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.

      I'm using Qlik Sense Cloud version fyi.

       

      I want to count the number of orders from returning customers vs new ones.

      For that I have a date of order (order_created_at) and a date of account creation for each customer (account_created_at).

       

      To calculate the KPI number of orders, I basically count the order this way

      count (distinct order_id)

       

      To calculate the KPI new customers, I would want to do exactly the same only if the dates are matching.

      if ( date(order_created_at) = date (account_created_at), then count (distinct order_id))

      This tells me there is an error so I tried also the following:

      if ( $(order_created_at) = $(account_created_at), then count (distinct order_id))

      There is no longer an error but it doesn't count anything as if the condition was never meant.


      Trying to read resources I'am a bit lost on how to proceed.

      I tried to use tables and variables to find my way around but without success so far.


      If anyone understands what I'm trying to achieve and have a solution it would be most welcomed.


      Many thanks

      RegnierP