Dashboard Tabs

Tal Mickel shared this question 1 year ago
Answered

Hi,


I am trying to run a query on YF repository in order to retrieve all the dashboards tabs.


SELECT *

FROM dbo.ReportGroup

WHERE StatusCode = 'OPEN'

AND GroupTypeCode = 'SUBTAB'


Although i filter on status open i get multiple records for every tab showing the tab's change history.


how can i filter the current open tab record and how can i link between the SUBTAB record to the Dashboard record?


Thanks!

Best Answer
photo

Hi Tal,


I believe that you may have had this code before

This should show all reports that are on dashboards as well as the type of dashboard and if it is on a sub-tab.


If the sub-tab value is null it isn't a sub-tab


SELECT

RG2.ShortDescription AS 'Dashboard'

, RG2.GroupTypeCode AS 'Type'

, CASE WHEN RG1.ShortDescription <> 'New Tab' THEN RG1.ShortDescription END AS 'Sub Tab'

, ReportHeader.ReportId AS 'Report Id'

, ReportHeader.ReportName AS 'Report'

FROM ReportHeader

LEFT OUTER JOIN ReportGroupEntity RGE1

ON RGE1.EntityId = ReportHeader.ReportId

AND RGE1.EntityTypeCode = 'REPORT'

LEFT OUTER JOIN ReportGroup RG1

ON RG1.GroupId = RGE1.GroupId

LEFT OUTER JOIN ReportGroupEntity RGE2

ON RGE2.EntityId = RG1.GroupId

LEFT OUTER JOIN ReportGroup RG2

ON RG2.GroupId = RGE2.GroupId


WHERE ReportHeader.ReportStatusCode = 'OPEN'

AND RG1.StatusCode = 'OPEN'

AND RG2.StatusCode = 'OPEN'


I think this was discussed with you in http://community.yellowfin.bi/agent/object/2370


Thanks,

Pete

Comments (7)

photo
1

Hello,


This is likely dependent on the database you are using (for formatting) but you should be able to select unique or top1 records for each type


If you can tell us what database you are using, we can give you better SQL commands! :)


I hope that helps,

Best regards,

Pete

photo
1

Hi,


Thanks for the quick response!


We are using SQL Server 2014 database.


can you also help with the second part of the question regarding linking between SUBTAB and dashboard.


Thanks!

photo
1

Hi Tal,


Try this:

SELECT DISTINCT

FROM dbo.ReportGroup

WHERE StatusCode = 'OPEN'

AND GroupTypeCode = 'SUBTAB'


I'm still looking into the "subtab" side of your question

I'll update you as I find out more!


Best regards,

Pete

photo
1

Hi Peter,


Thanks for the query!


Do you have something for the sub-tab dashboard connection?


Thanks!

photo
photo
1

Hi Tal,


I believe that you may have had this code before

This should show all reports that are on dashboards as well as the type of dashboard and if it is on a sub-tab.


If the sub-tab value is null it isn't a sub-tab


SELECT

RG2.ShortDescription AS 'Dashboard'

, RG2.GroupTypeCode AS 'Type'

, CASE WHEN RG1.ShortDescription <> 'New Tab' THEN RG1.ShortDescription END AS 'Sub Tab'

, ReportHeader.ReportId AS 'Report Id'

, ReportHeader.ReportName AS 'Report'

FROM ReportHeader

LEFT OUTER JOIN ReportGroupEntity RGE1

ON RGE1.EntityId = ReportHeader.ReportId

AND RGE1.EntityTypeCode = 'REPORT'

LEFT OUTER JOIN ReportGroup RG1

ON RG1.GroupId = RGE1.GroupId

LEFT OUTER JOIN ReportGroupEntity RGE2

ON RGE2.EntityId = RG1.GroupId

LEFT OUTER JOIN ReportGroup RG2

ON RG2.GroupId = RGE2.GroupId


WHERE ReportHeader.ReportStatusCode = 'OPEN'

AND RG1.StatusCode = 'OPEN'

AND RG2.StatusCode = 'OPEN'


I think this was discussed with you in http://community.yellowfin.bi/agent/object/2370


Thanks,

Pete

photo
1

Thanks!

photo
photo
1

Hello Tal,


I think we have covered everything in this ticket, so I'm going to close it down.


If you are still having problems, please reply here or open a new ticket.


Have a great day!

Best regards,

Pete