cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a custom filter that updates will filter selected

Astroraf
10 - ETL
10 - ETL
 Assume I  have an indicator type widget where we like to show a KPI and also % compared with 'the previous period' based on the date filter the user selects, we like the 'previous period' to dynamically update ie:
  • If the user selects 1 week, the previous period should be week 1.
  • if the user selects last month, the previous period should be the month before the last month.
  • If the user selects 10 days, the previous period should be prior 10 days

Is there a way to achieve this in Sisense with either user a custom function, BloX, or a plugin?

 

@DRay 

13 REPLIES 13

DRay
Community Team Member
Community Team Member

Hi @Astroraf,

It sounds like you want to select one time frame, and compare it to the previous same time frame. Is that accurate?

David Raynor (DRay)

More or less. What I want to be able to do is if one of my users selects a filter in regards to a certain timeframe i.e. say a week, the widget that has two parts would show the previous week, another example is if they pick a month filter say November, then it would show Octobers numbers. 

So the widget would change based on the date filter they choose would show the previous period. Another example for clarity would be if they show choose 2023 year, then it would show 2022 data. 

Do my examples make sense? 

DRay
Community Team Member
Community Team Member

Interesting. So if time-frame= X, comparison= -1x. I'll see what I can find.

David Raynor (DRay)

DRay
Community Team Member
Community Team Member

In my example, following the example provided, I inputted the Days in Date filter but I have not selected a day range.

Screen Shot 2024-07-02 at 13.42.40.png

In the new updated version of Sisense, we have this screen to choose from when filtering for Days in Date. It is not the same as the example, but I assume I can pick the last 30 days in this filter. I added the script and tried picking 30 days, but it still shows the same values compared to the widget that does not have a filter or the script. As shown in the last picture. 

Screen Shot 2024-07-02 at 13.44.18.png

The difference in numbers for the 2nd part of the indicator widget is due to choosing 30 days within the widget in the 2nd formula. 

Screen Shot 2024-07-02 at 13.52.01.png

 

I have chosen the a weeks timeframe and it is not showing me the previous timeframe. 

DRay
Community Team Member
Community Team Member

Hi @Astroraf.

Thank you for getting back to me. At this point let's get a support case open. They will either be able to find a solution or determine that a technical consultant is needed. Go ahead and link this post when creating the support case so they can reference it.

David Raynor (DRay)

Hi @DRay 

 

Will do, thanks for the support. 

DRay
Community Team Member
Community Team Member

Hello @Astroraf,

I wanted to follow up to see if the solution worked for you.

If so, please click the 'Accept as Solution' button so other users with the same questions can find the answer faster. If not, please let us know so that we can continue to help.

Thank you.

David Raynor (DRay)

DRay
Community Team Member
Community Team Member

Hello @Astroraf.

Was support able to help you with this? If so, can you share the solution here so others can find the answer?

Thank you.

David Raynor (DRay)

Hello @DRay,

 

I did not create a support ticket as my client said that DiffPastPeriod worked for his use case. 

DRay
Community Team Member
Community Team Member

I'm glad to hear they are up and running!

David Raynor (DRay)

Astroraf
10 - ETL
10 - ETL

@DRay come back to this point and realize that DiffPastPeriod did not achieve what I was looking for. Do you suggest opening a Sisense ticket regarding this matter?

DRay
Community Team Member
Community Team Member

Hi @Astroraf,

Yeah, let's get a support ticket opened up and see what they come up with.

David Raynor (DRay)