One Filter for Unions
Answered
I would like to know if there is a way to provide the user the ability to set one filter for a report I created using the Union in the report builder.
I would like to know if there is a way to provide the user the ability to set one filter for a report I created using the Union in the report builder.
Hi Peter! I'm not with YellowfinBI but that sounds like it could be resolved by choosing 'cache on demand' for the value list setup. If not, try a custom query maybe like
;WITH n(n) AS
(
SELECT 1
UNION ALL
SELECT n+1 FROM n WHERE n < 1000
)
SELECT dateadd(month, n, '2015-01-01') FROM n where dateadd(month, n, '2015-01-01') <= getdate() ORDER BY n
OPTION (MAXRECURSION 1000);
Hi Peter! I'm not with YellowfinBI but that sounds like it could be resolved by choosing 'cache on demand' for the value list setup. If not, try a custom query maybe like
;WITH n(n) AS
(
SELECT 1
UNION ALL
SELECT n+1 FROM n WHERE n < 1000
)
SELECT dateadd(month, n, '2015-01-01') FROM n where dateadd(month, n, '2015-01-01') <= getdate() ORDER BY n
OPTION (MAXRECURSION 1000);
Version 7.1... sorry
Version 7.1... sorry
HI Larry,
Thanks for getting in touch. If you include a filter in the primary query, you can then link a filter defined in the union sub-query to this:
Within the union sub-query set-up:
Does this seem like what you are looking for? If you have already considered this option and ruled against it, I would be interested in knowing a bit more about what your specific goals are so that I can provide a more relevant suggestion.
Regards,
Nathan
HI Larry,
Thanks for getting in touch. If you include a filter in the primary query, you can then link a filter defined in the union sub-query to this:
Within the union sub-query set-up:
Does this seem like what you are looking for? If you have already considered this option and ruled against it, I would be interested in knowing a bit more about what your specific goals are so that I can provide a more relevant suggestion.
Regards,
Nathan
This is exactly what I am looking for. I have several unions due to the way the data is stored. I initially had three filters separately defaulted to a value and the user had to change all three. This solution works perfectly. Thanks!
This is exactly what I am looking for. I have several unions due to the way the data is stored. I initially had three filters separately defaulted to a value and the user had to change all three. This solution works perfectly. Thanks!
No problem, glad to hear it worked!
No problem, glad to hear it worked!
Hi Ntahan I have a similar problem with union, but not completely the same.
I have 2 queries in a report from 2 different views put together with union. I need 1 filter as a prompt with "year-month" with all values from both queries together. I cant find a solution for that...
I have put the filter into both queries where the "union-filter" links to the master query, but it is only showing the filter values from the master query and I need both.
I could of course make the view on database level or write some custom SQL , but if there is an easy solution in YF I would like to know and use that :-).
Regards Peter
Hi Ntahan I have a similar problem with union, but not completely the same.
I have 2 queries in a report from 2 different views put together with union. I need 1 filter as a prompt with "year-month" with all values from both queries together. I cant find a solution for that...
I have put the filter into both queries where the "union-filter" links to the master query, but it is only showing the filter values from the master query and I need both.
I could of course make the view on database level or write some custom SQL , but if there is an easy solution in YF I would like to know and use that :-).
Regards Peter
Replies have been locked on this page!