Forum Discussion

AveryLeerling's avatar
AveryLeerling
Data Storage
05-31-2024
Solved

Sum for new date

Hello, Does someone know if in the reporting there is an fx that can calculate an new date, so as I can make in excel =date(today + 21 days)  = 21-june-2024 is that possible can someone help me?
  • david-h's avatar
    06-01-2024

    Hi,

    It depends on what you want to achieve.

    If you need to display a date + or - X days, it does not exist out of the box in Sisense. You can always use a Javascript script in your widget to do this.

    If you want to get the value of a KPI for date + or - X days, you can use the time windows functions : pastyear/pastmonth/pastweek/pastday or next and prev that can be used to get the KPI value at a relative date.

    For example, the values of Revenue 21 days ago you can use : ([Total Revenue],prev([Days in Date],21)). This will give the Total Revenue 21 days before the date in the current context.

    Best, David

  • david-h's avatar
    06-02-2024

    Hi Avery,

    For your use case I think you should do the calculation in the datamodel. It seems to be more a process calculation, and you will be able to visualize it in the dashboards.

    You can add a calculated column, DueDate, defined as adddays([RegisteredDate], 21)

    Best, David.