Deleting a calculated field from a view not possible (used in report) - but this is wrong
Defect Logged
Hi,
I have two calculated fields in a view that I cannot delete. YF claims they are still used in a report. But this is definitely wrong, both fields are not used (anymore).
I checked it with the following SQL, the result is clear. There is no report that still uses this field and YF is wrong.
How can I delete the two fields from the view? I have not found a knowledge article on this.
SELECT a.reportId, c.reportname, c.reportstatuscode FROM ReportField a INNER JOIN ReportFieldTemplate b ON (a.fieldtemplateid = b.fieldtemplateid) INNER JOIN ReportHeader c ON (c.reportId = a.reportId) WHERE b.shortdescription = 'calculated field name'; RESULT 102209 REPORT_NAME DELETED
Hi Stefan,
Thanks for reaching out to Yellowfin Support.
Before any backend modifications to the Yellowfin database are done, it would be good to confirm whether it is being used in a report or not. To do this the FieldTemplateID of the Freehand SQL Calculated Field must be obtained, this can be accomplished by running the following query:
SELECT FieldTemplateId FROM ReportFieldTemplate WHERE ShortDescription = '<insert column name here>'Then once in possession of the FieldTemplateId it is possible to find out which report(s) Yellowfin thinks is using the unused Freehand SQL Calculated Field by running the following query:
SELECT ReportId FROM ReportField WHERE FieldTemplateId = <insert FieldTemplateId here>
Then having confirmed that the Freehand SQL Calculated Field is not being used, it may be removed from the view by running the following query:DELETE FROM ReportFieldTemplate WHERE FieldTemplateId = <insert FieldTemplateId here>
and just to be tidy also run the following 2 queries (they mightn't be required). The ViewId is also available from the ReportFieldTemplate table:and this one:
Hopefully after performing these steps you will have been able to remove your unwanted column, please let me know how it goes.
Also, because you are playing around in the backend of your Yellowfin repository, please make sure to back it up immediately beforehand!
Regards,
Sri Vamsi
Hi Stefan,
Thanks for reaching out to Yellowfin Support.
Before any backend modifications to the Yellowfin database are done, it would be good to confirm whether it is being used in a report or not. To do this the FieldTemplateID of the Freehand SQL Calculated Field must be obtained, this can be accomplished by running the following query:
SELECT FieldTemplateId FROM ReportFieldTemplate WHERE ShortDescription = '<insert column name here>'Then once in possession of the FieldTemplateId it is possible to find out which report(s) Yellowfin thinks is using the unused Freehand SQL Calculated Field by running the following query:
SELECT ReportId FROM ReportField WHERE FieldTemplateId = <insert FieldTemplateId here>
Then having confirmed that the Freehand SQL Calculated Field is not being used, it may be removed from the view by running the following query:DELETE FROM ReportFieldTemplate WHERE FieldTemplateId = <insert FieldTemplateId here>
and just to be tidy also run the following 2 queries (they mightn't be required). The ViewId is also available from the ReportFieldTemplate table:and this one:
Hopefully after performing these steps you will have been able to remove your unwanted column, please let me know how it goes.
Also, because you are playing around in the backend of your Yellowfin repository, please make sure to back it up immediately beforehand!
Regards,
Sri Vamsi
Hi Stefan,
Thanks for your reply.
I have raised a jira task to the development team. I'll provide an update here as soon as I receive an update from them.
Regards,
Sri Vamsi
Hi Stefan,
Thanks for your reply.
I have raised a jira task to the development team. I'll provide an update here as soon as I receive an update from them.
Regards,
Sri Vamsi
Hi Stefan,
I have reviewed your problem and I would like you to try the following steps below :
If you see that the calculated fields are still being used in a report, but you are certain that they are not, it's possible that the references to those fields exist in unpublished or hidden reports. You could try the following steps to see if that's the case:
If you still cannot delete the calculated fields from the view, even after following the steps above, you could try creating a copy of the view, and then deleting the calculated fields from the copy.
Regards,
Sri Vamsi
Hi Stefan,
I have reviewed your problem and I would like you to try the following steps below :
If you see that the calculated fields are still being used in a report, but you are certain that they are not, it's possible that the references to those fields exist in unpublished or hidden reports. You could try the following steps to see if that's the case:
If you still cannot delete the calculated fields from the view, even after following the steps above, you could try creating a copy of the view, and then deleting the calculated fields from the copy.
Regards,
Sri Vamsi
Hi Stefan,
Hope things are good on your end. Just wanted to check in to make sure you had what you needed here.
Regards,
Sri Vamsi
Hi Stefan,
Hope things are good on your end. Just wanted to check in to make sure you had what you needed here.
Regards,
Sri Vamsi
Replies have been locked on this page!