cancel
Showing results for 
Search instead for 
Did you mean: 

Front-End Running Sum using Filtered Measure - Background Filters help

turtleData123
9 - Travel Pro
9 - Travel Pro

Hey all,

Recently we created a widget using the Filtered Measure plugin (found here)  and applied the steps found on this post to create a running sum on a column widget. This works very well but for one thing, and I was hoping someone in the community found a solution or a definitive 'no' - background filters on our dashboard filters break the running sum. To my understanding, this is because, the background filter is applied prior to the plugin working its magic  and thus the plugin can only include dates after the filter is applied. So, for instance, without a background filter, we get dates for the range of a whole month, and with the background filter, we get dates excluding weekends.

The formula we're using:

 

(Rsum([Total GROUPEXTNETREVENUEAMT]), [@Transaction Type], [@Brand]) + ([# of unique Days in CALENDARDATE]*0)

 

and we've got background filters on both Transaction Type and Brand. Removing those filters, as above, gives us the dates we want, I was just hoping someone's found a way around this issue, or can give me a definitive 'No, it won't work.'

 

1 ACCEPTED SOLUTION

turtleData123
9 - Travel Pro
9 - Travel Pro

For anyone looking for a solution - I found a way to bypass background filters on a dashboard by turning off the filter item and hiding it from view:

dashboard.on('widgetready', (d, args) => {
	list = document.getElementsByClassName('list-item slf-back-hov')
	$.each(list, function(index, element) {
 		if(element.innerText === 'BK' || element.innerText === 'N\\A'){
			$(element).css({
				'display': 'none' })
		}
	});
	items = document.getElementsByClassName('uc-ms-toprow')
	$.each(items, function(index, element) {
		if (index > 0) {
			$(element).css({
				'display': 'none' })
		}
	});
});

'BK' and 'N\\A' refer to the INNER TEXT of the item, as our filter shows 'N\A' to the end user, but replace those with the names of the filter items you'd like to remove and you're good to go

This also removes the 'select all' button, as when that's pressed, it will select all filter items without a way to turn the hidden ones off.

View solution in original post

2 REPLIES 2

turtleData123
9 - Travel Pro
9 - Travel Pro

For anyone looking for a solution - I found a way to bypass background filters on a dashboard by turning off the filter item and hiding it from view:

dashboard.on('widgetready', (d, args) => {
	list = document.getElementsByClassName('list-item slf-back-hov')
	$.each(list, function(index, element) {
 		if(element.innerText === 'BK' || element.innerText === 'N\\A'){
			$(element).css({
				'display': 'none' })
		}
	});
	items = document.getElementsByClassName('uc-ms-toprow')
	$.each(items, function(index, element) {
		if (index > 0) {
			$(element).css({
				'display': 'none' })
		}
	});
});

'BK' and 'N\\A' refer to the INNER TEXT of the item, as our filter shows 'N\A' to the end user, but replace those with the names of the filter items you'd like to remove and you're good to go

This also removes the 'select all' button, as when that's pressed, it will select all filter items without a way to turn the hidden ones off.

DRay
Community Team Leader
Community Team Leader

Hi @turtleData123,

Thank you for the follow-up with your solution. I'm glad you were able to get this working!

David Raynor (DRay)