3 Replies Latest reply: May 21, 2015 1:42 PM by Corey Creed RSS

    Date Calculation Question

      Hello Community Members!


      This is my first week working with Qlik Sense Desktop and as thrilled as I am, I get stuck occasionally.  This community helped me extremely well last time and I'm hoping someone can help me with this one as well.


      I have one table that uses the date field like this:

      Date - Transactions.JPG


      Thanks to the community, I now have that interpreted by using this formula:

          Date(DATE#(left("date/time",len("date/time")-4),'MMM DD, YYYY hh:mm:ss tt')) as Date,


      But now I also have another table that makes the date like this:

      Date - Ads.JPG


      I'd like to think I was smart enough to figure this one out, so I used this formula:

          Date(DATE#("Start Date",'MM/DD/YYYY hh:mm')) as AdDate,


      It seemed to work.  I have both tables loaded and they are connected with the key field "sku".


      See below:

      Data Model.JPG


      NOTE:  I made the two date fields as different fields (Date for one and AdDate for the other).  That seemed to be the right thing to do.  But I'm not sure.  I'll get back to that in a minute.


      At any rate, you can see that I have a list of total transactions and transactions from Paid Ads only.


      The image below shows how I can see both the total transactions and the transactions from Paid Ads.


      Sales vs Paid.JPG


      Looking at the bar graphs above..

      • The top one uses the dimension =Day(Date)
      • The bottom one uses the dimension =Day(AdDate)


      I would now like to create a third bar graph right below this that shows the difference between the two.




      Should I have handled the importing of the dates differently?  If so, how?


      Is there a way to do the math to get the table I want above if the dates are two different fields?


      I really appreciate the help and apologize if it is so newbie I should know better.  (It seems as if dates are the hard part for me.)