Get all date between two dates

Comments

3 comments

  • Avatar
    Michael Ryzewic

    This is very tough to do in Sisense directly, because of lack of support for temp tables and window functions in the very "vanilla" SQL that is provided. A couple of ways come to mind to do this off the top of my head, neither of which I particularly love:

    Using an Excel/CSV Data Source

    • Create a comprehensive list of dates in an Excel or CSV file.
    • Import this into your Elasticube.
    • Use a custom SQL function to select the dates, i.e.

    SELECT

      date_col FROM [big_date_list]

    WHERE date_col >= '2018-1-1' AND date_col <= Now()

    UNION

    SELECT

      date_col FROM [big_date_list]

    WHERE date_col >= '2017-1-1' AND date_col <= AddYears(Now(),-1)

     

    Use Your Database

    Not knowing your setup, I can't provide details here. The short version is, this is easy to achieve in most modern SQL environments, so if you are able to create this function as a VIEW on your database, you can pull it into Sisense and use it (many solutions for this available via Google).

    Hope this helps!

    3
    Comment actions Permalink
  • Avatar
    Linh Cao

    Thank you so much! I'll create a view on my database.

    0
    Comment actions Permalink
  • Avatar
    Roopa Raghavan

    @Michael Ryzewic - your solution helped me pull data between 2 dates in the elasticube. Thank you !!

    0
    Comment actions Permalink

Please sign in to leave a comment.