cancel
Showing results for 
Search instead for 
Did you mean: 
OleksandrB
Sisense Team Member
Sisense Team Member

Show the Data for This and Last Year, But Not the Current Month Dynamically

Task: We want to show data for this and last year, but not the current month dynamically.

For example, we have this data:

Screenshot_26.png


We want to show it, but not for the current month, as the information for it is still in process.

So, we create a Line Chart widget 

Screenshot_23.png


With Months in Date in X-Axis and Total revenue in Values.

Now we will create a custom filter based on Months in Date.

Screenshot_25.png

 
The code of the filter is

 

{
  "or": [
    {
      "next": {
        "count": 24,
        "offset": 1
      }
    },
    {
      "last": {
        "count": 24,
        "offset": 1
      }
    }
  ],
  "multiSelection": true
}

 


In this filter, we have two parts which connected to OR

Select the next 12 months, but not the current

 

    {
      "next": {
        "count": 12,
        "offset": 1
      }
    }

 


Select last 12 months, but not current

 

    {
      "last": {
        "count": 12,
        "offset": 1
      }
    }

 


If necessary, you can use just the part of the filter that you need.

And as the final result we will get the next data without the current month (it is May 2024)

Screenshot_27.png

Rate this article:
Version history
Last update:
‎05-22-2024 08:54 AM
Updated by: