7 Replies Latest reply: Jul 13, 2017 8:27 AM by Sunny Talwar RSS

    What is wrong with my date set expression

    Natalie Watson

      Hi guys,

       

      I can't get set expressions working with dates. e.g. Show me only row counts for first day of last month.

       

       

      Capture.PNG

       

      The column is calculated as:

       

      Count({<Date={"$(=date(MonthStart(today(),-1)),'DD/MM/YYYY')"}>}ID)

       

      I would expect to see values in the 2nd and 4th row, but instead I see 0 for every row. The date format seems to match (as you can see in KPI indicator). The data model is super simple:

       

       

       

      Load

      ID,

      date(date#(date, 'YYYY-MM-DD'), 'DD/MM/YYYY') as [Date],

      date(date#(activation_date, 'YYYY-MM-DD'), 'DD/MM/YYYY') as [Activation Date];

       

      Select

      ID,

      cast(created as date) as date,

      cast(activation_date as date) as activation_date

      from table;

       

      What am I doing wrong?