Deleting a calculated field from a view not possible (used in report) - but this is wrong

Stefan Hall shared this problem 9 months ago
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

Replies (4)

photo
1

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:

DELETE FROM ReportConstraint WHERE ViewId = <insert ViewId here> AND ConstraintEntityTypeCode = 'COLUMN' AND ConstraintEntityId = <insert FieldTemplateId here>
and this one:


DELETE FROM ReportFieldParameter WHERE ViewId = <insert ViewId here> AND EntityTypeCode = 'REPORTFIELDTEMPLATE' AND EntityId = <insert FieldTemplateId here>
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

photo
1

Hi Vamsi,

I have already answered your first question with the SQL output. It will use in a deleted report.

In this respect YF makes a mistake here and the hint "used" is wrong.
What exactly is YF checking here? Report = DELETED should be sufficient, right?

Regards
;) Stefan

photo
photo
1

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

photo
1

Hi Vamsi,

is "awaiting reply" the correct status? I always think I still have to reply and look at the ticket unnecessarily often.
We are waiting for an internal reply from the YF Dev team after all.

;) Stefan

photo
photo
1

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:

  1. Go to the "Manage Content" page in Yellowfin.
  2. Click on the "Reports" tab.
  3. Use the search bar to look for reports that might be using the calculated fields in question.
  4. If you find any reports that might be using the fields, check if they are unpublished or hidden. You can see this information in the "Visibility" column of the report list.
  5. If the report is unpublished or hidden, click on the report name to edit it.
  6. Once you are in the report editor, search for the calculated fields in the "Fields" panel on the right side of the screen. If the fields are being used, you should see them listed here.
  7. Remove the fields from the report if they are present.
  8. Save and publish the report, if necessary.
  9. Try deleting the calculated fields from the view again.

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

photo
1

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

photo
1

Hi Vamsi,

is there already a new status from the development team? I had the "error" another time - a deleted report locks a field in the view. From my point of view this should not be the case.

;) Stefan

photo
1

Hi Stefan,

I already raised a Jira task to Dev Team. I'll let you know once I receive an update from Dev team.

Regards,

Sri Vamsi

photo
Leave a Comment
 
Attach a file