Why some fisical tables&columns aren't available in some views for Freehand SQL calculated fields?
Hi,
We have two views in our data model which points to the same physical table (YF_COURSE) and, among others, with the same physical column (COURSE_ID).
If we create a report from each view with the logical column ("Courses"."Course id"), both works. If we display the SQL related to both reports, both SQLs display "YF_COURSE.COURSE_ID" as the physical column.
The problem appears when we create a Freehand SQL calculated field with this SQL code:
substr(YF_COURSE.COURSE_ID,7,1) to get the 8th digit.
We are able to create the calculated field and make it work in view A but we are even able to create it in view B. The error message says:
Why does it work in view A and doesn't work in view B?
Thank you very much for your help.
Best Regards,
Joan.
Hi again,
A bit more information: after making some tests with several views and tables we have realised that, for each view, it is only possible to use, in the Freehand Sql calculated field, the columns from the mandatory table. Are we right?
Is it the right working or it is a bug? In both cases, how could we bypass this situation to be able to use the Freehand Sql calculated field for all the view columns?
Many thanks for your help.
Best Regards,
Joan.
Hi again,
A bit more information: after making some tests with several views and tables we have realised that, for each view, it is only possible to use, in the Freehand Sql calculated field, the columns from the mandatory table. Are we right?
Is it the right working or it is a bug? In both cases, how could we bypass this situation to be able to use the Freehand Sql calculated field for all the view columns?
Many thanks for your help.
Best Regards,
Joan.
Hi Joan,
Thanks for getting in touch about this, apologies for the delayed response!
You nailed it after poking around a bit more. Freehand SQL queries require that any referenced table be marked as 'Mandatory' in the view in order for the query to successfully run. The error that the freehand builder returned was your Oracle database saying that it couldn't find the table you were asking it to, because the table was not marked as Mandatory in the view. Although it would be nice if Yellowfin were capable of giving a more helpful error message, this is indeed expected behavior, and is due to the way that the view system is structured.
Unfortunately, the only surefire solution that I see to this is to mark all of the tables as Mandatory in the view that you anticipate being used in Freehand SQL queries. It sounds like you already know where this setting is, but I've attached a screenshot just in case :)
I'm sorry that I don't have a better workaround for you, but please let me know if you have any further questions on this.
Thanks!
-Conner
Hi Joan,
Thanks for getting in touch about this, apologies for the delayed response!
You nailed it after poking around a bit more. Freehand SQL queries require that any referenced table be marked as 'Mandatory' in the view in order for the query to successfully run. The error that the freehand builder returned was your Oracle database saying that it couldn't find the table you were asking it to, because the table was not marked as Mandatory in the view. Although it would be nice if Yellowfin were capable of giving a more helpful error message, this is indeed expected behavior, and is due to the way that the view system is structured.
Unfortunately, the only surefire solution that I see to this is to mark all of the tables as Mandatory in the view that you anticipate being used in Freehand SQL queries. It sounds like you already know where this setting is, but I've attached a screenshot just in case :)
I'm sorry that I don't have a better workaround for you, but please let me know if you have any further questions on this.
Thanks!
-Conner
Hi Conner,
Many thanks for your explanation. If there isn't any other choice, we will have to think about setting the required table as mandatory.
Just in case: what we would like to do is to create a calculated field which would include a substring of the regular field. We thought there wasn't any other choice that using SQL functions. Because of that, we had to use Freehand SQL calculated fields. Do you know if there is any other way to create a substring of a field without using Freehand SQL calculated fields?
Many thanks for your help.
Best Regards,
Joan.
Hi Conner,
Many thanks for your explanation. If there isn't any other choice, we will have to think about setting the required table as mandatory.
Just in case: what we would like to do is to create a calculated field which would include a substring of the regular field. We thought there wasn't any other choice that using SQL functions. Because of that, we had to use Freehand SQL calculated fields. Do you know if there is any other way to create a substring of a field without using Freehand SQL calculated fields?
Many thanks for your help.
Best Regards,
Joan.
Hi Joan,
Apologies for the delayed response here!
There may be another solution to this, however, I would guess that it will result in overall lower performance than marking specific tables as mandatory. Yellowfin has an option at the view level called 'Optimize View'. You can read up a bit on it here, but the short version is that this option cuts unneeded tables out of queries at the report level. So while not using this option will not require you to mark particular tables as mandatory, you may experience some performance degradation as a result of the inclusion of all of the tables in the view.
In regards to creating a substring, I believe that you're correct. The only way to accomplish this will be to build a Freehand SQL calculated field. (Remember that the table you're using will have to marked as Mandatory.)
Hopefully this gives you a little more to go on. Please let me know if you have any further questions!
Thanks,
-Conner
Hi Joan,
Apologies for the delayed response here!
There may be another solution to this, however, I would guess that it will result in overall lower performance than marking specific tables as mandatory. Yellowfin has an option at the view level called 'Optimize View'. You can read up a bit on it here, but the short version is that this option cuts unneeded tables out of queries at the report level. So while not using this option will not require you to mark particular tables as mandatory, you may experience some performance degradation as a result of the inclusion of all of the tables in the view.
In regards to creating a substring, I believe that you're correct. The only way to accomplish this will be to build a Freehand SQL calculated field. (Remember that the table you're using will have to marked as Mandatory.)
Hopefully this gives you a little more to go on. Please let me know if you have any further questions!
Thanks,
-Conner
Replies have been locked on this page!