Report Execution Order

Ruan Steyn shared this question 6 years ago
Answered

I was experiencing a funny issue with combining Calculated Fields, with Advanced Functions and Sub Queries in a report to do an advanced calculation and stumbled upon the following info regarding Calc Fields vs Adv Functions.


"Advanced functions allow you to perform operations on top of report data after the primary SQL query has been run, unlike a calculated field, which is added to the report’s SQL statement"


Ex. We started with an Advanced Function field, divided by a field from the Sub Query and then needed to multiply it by another field on the Master... Which refused to allow us to select the final field. We had to move the field into a Sub Query to get it to work as part of the Calculation.

So I had to change the order of calculation to make use of the Master Query, the Calc Fields, the Adv Functions and values from the Master and Sub Queries to get it all to work and was wondering if anyone knows the "Execution Order" in which YF goes about running a report?

Replies (3)

photo
1

Hi Ruan,

Thanks for reaching out with your question. Unfortunately, the Execution Order YF takes when running a report isn't an officially or publicly documented process. That being said, your quote goes far into answering the question proposed.

From the Wiki on Advanced Functions:

"Advanced Functions are used to transform results by applying post processing calculations to the initial query results. These functions are database independant as they are performed by Java code, rather than being part of the SQL query."

From the Wiki on Calculated Fields:

"With Yellowfin’s view builder you can create derived columns based on the fields sourced from the database. These calculations can include simple mathematical calculations or more complex SQL statements."

Which, as you alluded to above indicates that Calculated Fields are written into the Report SQL.

On the note of Sub Queries, I presume these are run as a whole with the Report SQL.

So based on these determinations, we can create a bit of a crude order for this scenario as follows:

  1. Yellowfin runs the Report SQL - which will include any Calculated Field SQL.
  2. Yellowfin returns the results of the query into the application.
  3. Yellowfin applies any post calculations, such as Advanced Functions to the data.
  4. Yellowfin displays the data in a report as configured.

I'd be happy to review the steps you were taking in order to verify the behavior you're experiencing. If you'd like, please provide some detailed information on the report itself along with screenshots of the Data tab so that I can better visualize the process you're taking.


Does this help?

Thanks,

Ryan

photo
1

Hi Ruan,

I wanted to reach out and see if you had a chance to review my reply. If I don't hear back, I'll presume my response has answered your inquiry.

Thanks,

Ryan

photo
1

Hi Ruan,

I haven't heard back from you on this for some time. I'm going to mark this as Answered, please don't hesitate to reach out with further questions or issues.

Thanks,

Ryan

Leave a Comment
 
Attach a file