Business objects Query Builder question
2 posters
Page 1 of 1
Business objects Query Builder question
I have the following query that will list scheduled instances. The client wants to see this query differently.
They want to see all the null end time instances first followed by not null endtime instances in descending order. I tried doing union query something like below but query builder fails and does not recognize query. Is there a limitation on query builder or is it a full fledged query engine. Any Idea how can I achieve nulled endtime followed by not nulled end time in descending order. Following query does not work but when I run seaparately without union both queries work fine. I also tried doing sub query but I think sub query is not allowed either. Can you tell me if there is any query limitation in QB or any alternative you can think of? Thanks
SELECT
SI_ID, SI_NAME, SI_DESCRIPTION, SI_SCHEDULE_STATUS, SI_NEXTRUNTIME,
SI_STARTTIME, SI_ENDTIME, SI_SCHEDULEINFO.SI_OBJID, SI_SCHEDULEINFO.SI_SCHED_NOW
FROM
CI_INFOOBJECTS
WHERE
SI_KIND = 'Webi'
AND SI_INSTANCE = 1
AND SI_SCHEDULEINFO.SI_SUBMITTER = '11.2'
AND (SI_SCHEDULE_STATUS != 9 OR SI_NEXTRUNTIME < '03/13/2013 05:46:55')
AND SI_ENDTIME is null
UNION
SELECT
SI_ID, SI_NAME, SI_DESCRIPTION, SI_SCHEDULE_STATUS, SI_NEXTRUNTIME,
SI_STARTTIME, SI_ENDTIME, SI_SCHEDULEINFO.SI_OBJID, SI_SCHEDULEINFO.SI_SCHED_NOW
FROM
CI_INFOOBJECTS
WHERE
SI_KIND = 'Webi'
AND SI_INSTANCE = 1
AND SI_SCHEDULEINFO.SI_SUBMITTER = '11.2'
AND (SI_SCHEDULE_STATUS != 9 OR SI_NEXTRUNTIME < '03/13/2013 05:46:55')
AND SI_ENDTIME is not null
ORDER BY SI_ENDTIME DESC
They want to see all the null end time instances first followed by not null endtime instances in descending order. I tried doing union query something like below but query builder fails and does not recognize query. Is there a limitation on query builder or is it a full fledged query engine. Any Idea how can I achieve nulled endtime followed by not nulled end time in descending order. Following query does not work but when I run seaparately without union both queries work fine. I also tried doing sub query but I think sub query is not allowed either. Can you tell me if there is any query limitation in QB or any alternative you can think of? Thanks
SELECT
SI_ID, SI_NAME, SI_DESCRIPTION, SI_SCHEDULE_STATUS, SI_NEXTRUNTIME,
SI_STARTTIME, SI_ENDTIME, SI_SCHEDULEINFO.SI_OBJID, SI_SCHEDULEINFO.SI_SCHED_NOW
FROM
CI_INFOOBJECTS
WHERE
SI_KIND = 'Webi'
AND SI_INSTANCE = 1
AND SI_SCHEDULEINFO.SI_SUBMITTER = '11.2'
AND (SI_SCHEDULE_STATUS != 9 OR SI_NEXTRUNTIME < '03/13/2013 05:46:55')
AND SI_ENDTIME is null
UNION
SELECT
SI_ID, SI_NAME, SI_DESCRIPTION, SI_SCHEDULE_STATUS, SI_NEXTRUNTIME,
SI_STARTTIME, SI_ENDTIME, SI_SCHEDULEINFO.SI_OBJID, SI_SCHEDULEINFO.SI_SCHED_NOW
FROM
CI_INFOOBJECTS
WHERE
SI_KIND = 'Webi'
AND SI_INSTANCE = 1
AND SI_SCHEDULEINFO.SI_SUBMITTER = '11.2'
AND (SI_SCHEDULE_STATUS != 9 OR SI_NEXTRUNTIME < '03/13/2013 05:46:55')
AND SI_ENDTIME is not null
ORDER BY SI_ENDTIME DESC
LUCY.ONLINE- Posts : 4
Join date : 2012-06-01
single query instead of union
Instead of using union you can achieve this in single sql query as below
SELECT
SI_ID, SI_NAME, SI_DESCRIPTION, SI_SCHEDULE_STATUS, SI_NEXTRUNTIME,
SI_STARTTIME, SI_ENDTIME, SI_SCHEDULEINFO.SI_OBJID, SI_SCHEDULEINFO.SI_SCHED_NOW
FROM
CI_INFOOBJECTS
WHERE
SI_KIND = 'Webi'
AND SI_INSTANCE = 1
AND SI_SCHEDULEINFO.SI_SUBMITTER = '11.2'
AND (SI_SCHEDULE_STATUS != 9 OR SI_NEXTRUNTIME < '03/13/2013 05:46:55')
ORDER BY SI_ENDTIME NULLS FIRST
Let me know if this is successful.
SELECT
SI_ID, SI_NAME, SI_DESCRIPTION, SI_SCHEDULE_STATUS, SI_NEXTRUNTIME,
SI_STARTTIME, SI_ENDTIME, SI_SCHEDULEINFO.SI_OBJID, SI_SCHEDULEINFO.SI_SCHED_NOW
FROM
CI_INFOOBJECTS
WHERE
SI_KIND = 'Webi'
AND SI_INSTANCE = 1
AND SI_SCHEDULEINFO.SI_SUBMITTER = '11.2'
AND (SI_SCHEDULE_STATUS != 9 OR SI_NEXTRUNTIME < '03/13/2013 05:46:55')
ORDER BY SI_ENDTIME NULLS FIRST
Let me know if this is successful.
LearnDW- Posts : 1
Join date : 2013-03-18
Similar topics
» 3 objects in the query that is causing the measure object to multiple. By 2
» Business Objects and the use of contexts
» Drill Across Fact Tables with Report Builder
» Handling fact tables with different grain in Business Objects
» Query on Dimensions
» Business Objects and the use of contexts
» Drill Across Fact Tables with Report Builder
» Handling fact tables with different grain in Business Objects
» Query on Dimensions
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum