Use subquery's calculated field in master's calculated field
I'm having a hard time to create a calculated filed in master query.
Details:
The calculated filed in master query uses fields from two different subqueries, one is a calculate dfiled in a subquery, the other one is just a normal date field in subquery. For example,
forecast_date: date field in forecast subquery
plan_date: calculated filed in plan subquery (view level)
actual_date: field in master query
and the final calculated filed that needs to be created in master query is:
final_date = case when actual_date is not null then actual_date else (case when forecast_date is not null then forecast_date else plan_date).
I have tried to create a calculate filed in master query for `case when forecast_date is not null forecast_date else plan_date`, however this calculated filed is not accessible when trying to create the final_date calculate field in master query.
Wondering if there's any workaround? Thanks in advance.
Hi Xuan,
As mentioned in a similar ticket, if you are not able to achieve this through the current functionality (which is geared around constructing an SQL statement), then you will need to build these final calculations into advanced functions, which are applied in post-processing.
If our current advanced functions do not do the trick, you might want to look into coding your own advanced function:
http://wiki.yellowfin.com.au/display/USER74/Custom+Advanced+Functions
Regards,
Nathan
Hi Xuan,
As mentioned in a similar ticket, if you are not able to achieve this through the current functionality (which is geared around constructing an SQL statement), then you will need to build these final calculations into advanced functions, which are applied in post-processing.
If our current advanced functions do not do the trick, you might want to look into coding your own advanced function:
http://wiki.yellowfin.com.au/display/USER74/Custom+Advanced+Functions
Regards,
Nathan
Replies have been locked on this page!