Dashboard Queries do not all refresh

This is a very detailed drawing of a dashboard I am working on right now. The arrows represent parameters I am passing between queries. Everything seems to work great except when some queries do not return data.

Per this post Dashboard not refreshing 2nd query I have found that my issue lies in the fact that when a query does not return data, it does not have a selected row, and therefore does not notify any queries that subscribe to it’s data that they should now take blank inputs.

Any ideas on how to best refresh some queries based off which query goes blank? My initial thought was an AfterRowChange method in a UI customization, but that seems to get called multiple times per row change, so multiple refreshes per row change could take a lot of time.

I’ve had other experience, where if a publishing query doesn’t return a row, it runs the subscribing dashboard wide open, which can lock up the UI while it waits for the query to return.

I do no know of a way to run a subscribing query if no row returns in dashboard land. I believe you would have to make your own from scratch. (like use a emptied out UD screen and add your own stuff)… But yuck!

1 Like

It would be interesting to hear if this is happening @Ross.Fireball.Kuiper

Would it be acceptable to force your queries to return a dummy row?

Here is more or less what I am getting:

This row gives me data in all queries.

This row only populates the first two queries, but the third query does not update what it is publishing so the side query and bottom two queries still show the data from the previous row.

This is something I thought of as well, I’m just not sure how to get it to work. Would the dummy row then show even if the query returned results? (Because that would not be ideal)

You can cheat by adding a union with calculated fields, with one of those fields being a sort or something, then filtering by max or min

a b sort
row1real 1 2
row2real 1 2
unionfake 1
a b sort
unionfake 1

filter by max sort, If there rows, it returns the real rows, if not it returns the dummy row.

2 Likes

You could turn all your queries into UBAQs and do a postprocessing on getlist and do a count
and filter.

Sounds like a bit of work, but depends on how bad you want it.

I’ll have to wrap my head around that when it works again. But sweet, I’ll take your word for it :slight_smile:

Edit: I think I get it now.

This sounds promising I think I will try it and report back.

1 Like

Follow up question, where am I putting this filter. I’m not seeing a way to do the Max filter in the dashboard. (Or at least when I tried doing Calc_SortLevel = Max(Calc_SortLevel) it didn’t work)

The filter would be in the BAQ… You’ll probably have to make levels to make this work, but if you do a calculated field like this.

max(sortNumber) over (partition by somethingCommonForAllRows)

Then do a subquery criteria where your calculated sort number equals your calculated field to find the max.

See if you can figure that out. If not, I can work up an example.

the nice thing about this, is that I’m doing a presentation about this topic at insights… so this could be a sweet little example to show.

2 Likes

Sweet

Well, crap,.

That’s only going to work with parameters…

Rethinking…

I got the dummy row, and the filter that it should match on. But that’s not going to change based on the what you put in a dashboard tracker.

image

Here’s the rows that it would return with no filter.

DummyRowNoFilter

This is adding a filter for SortNumber = FilterCalc
DummyRowWFilter

Are the queries that are returning empty sets subscribing queries? If they are you can set the filter on the dashboard to a parameter, and I believe that this should work.

Here’s the BAQ if you want to see what I did. Change the company dummy field to your company or whatever field you want to add in there to do your partition.

BrandonInsights2023-2.baq (42.8 KB)

Again, this only works if you can live with parameters.

Otherwise probably @klincecum 's idea of a post processing on get list to remove the dummy row if necessary could work.

Ah I guess 10.2.700 can’t import the BAQ you sent.

image

Would you be able to screenshot the FilterCalc portion so I can make sure I understand that part?

This should be everything that you need to create this. Let me know if you have problems with it.

image

image

image

Here’s the SQL too if you want to look at that.

/*
 * Disclaimer!!!
 * This is not a real query being executed, but a simplified version for general vision.
 * Executing it with any other tool may produce a different result.
 */
 
select 
	[TopLevel].[Part_Company] as [Part_Company],
	[TopLevel].[Part_PartNum] as [Part_PartNum],
	[TopLevel].[Calculated_SortNumer] as [Calculated_SortNumer],
	[TopLevel].[Calculated_FilterCalc] as [Calculated_FilterCalc]
from  (select 
	[InfoLevel].[Part_Company] as [Part_Company],
	[InfoLevel].[Part_PartNum] as [Part_PartNum],
	[InfoLevel].[Calculated_SortNumer] as [Calculated_SortNumer],
	(max(InfoLevel.Calculated_SortNumer) over (partition by InfoLevel.Part_Company)) as [Calculated_FilterCalc]
from  (select 
	[Part].[Company] as [Part_Company],
	[Part].[PartNum] as [Part_PartNum],
	(2) as [Calculated_SortNumer]
from Erp.Part as Part
where (Part.PartNum = @PartNum)
union
select 
	('C001') as [Calculated_CompanyFill],
	('') as [Calculated_PartNumFill],
	(1) as [Calculated_SortNumber])  as InfoLevel)  as TopLevel
where (TopLevel.Calculated_SortNumer = TopLevel.Calculated_FilterCalc)
2 Likes

I tell you what I will definitely be coming back to this a lot, this is a very different way than I have looked at BAQs in the past, but it works and seems very useful. I appreciate the walkthrough.

Note: I make not guarantees on if this is efficient or not. It just lets me do it… So take it with a grain of salt. I haven’t done any analysis if this is a crappy way to do it. It could be (probably is) much more efficient to run your query, then on post processing get list, count the rows, and if 0 then add a blank row. But if you don’t want to mess with that, this is a way to do it.

My brain is telling we could get that down to 3 subqueries instead of 4, but it just
won’t make the leap :imp: