[Excel Source].[Measure 1] where [Excel Source].[Dimension 1] in [SQL Query 1].[Dimension]?
Is this possible in WEBI XI ?
If not is there a way to get pass the issue?
Hi Anthony ,
This is doable .We may need to have 2 universes ,1 for Excel source and other for SQL server.
Then apply Dimension in SQL universe as a prompt .
Drag Dimension in Excel universe to Query filters pane .
From Type of filters drop down select "Result From another Query" . Select The Dimension object of SQL Universe.
Similar Messages
-
CrystalRpts - Excel Data source, SQLServer2005 table. SQL Query behavior?
Greetings - What should be a simple report (with Excel 2007 spreadsheet as primary data source linking to a SQLServer 2005 table ) returns incorrect results. Query designed to select data from SQL Table with 'DATES >=' certain date, but data returned ignores the DATE qualifier.
Running DATE query manually against the SQL Table proves the data is correct.
Anyone notice problems with SQL Query behavior when mixing data sources? Thanks.Hello,
Take the SQL that works outside of CR and then create a new report and add all data sources. Now use a Command Object and paste in your SQL. YOu may have to play with adding each data source in a different order. If that works great if not you'll have to figure out a way to get all the data into one source.
I believe MS SQL Server can link multiple data sources and types. Check SQL Help file for more info it it is possible.
Thank you
Don -
Problem using function call in WHERE part of a Report's SQL query
I tried doing some searches on this, but couldn't find anything. I'm trying to run something similar to the following query in my report, but keep getting a "Query cannot be parsed within the Builder" error:
SELECT function1(TABLE2.ID) A
FROM TABLE1, TABLE2
WHERE TABLE1.ID = TABLE2.ID AND
TABLE1.NAME = 'BLAH' AND
TABLE2.DATE > SYSTIMESTAMP AND
(function2(TABLE2.ID) = 'YES' OR
function3(:USER_ID) = 'YES')
ORDER BY TABLE1.NAMEWhy won't this work? I can take out the 2 lines with function calls from the WHERE clause, and it works, so I'm assuming that APEX doesn't like something about my function calls. I know the functions are valid and work properly, because I tested them independently. Can anyone see what the problem is? Thanks!Here's the actual query:
SELECT BUILD_EXT_RES_LIST(EXT_FILE.ID) A
FROM EXT_FILE_RES, EXT_FILE
WHERE EXT_FILE_RES.ON_OWNER_PROFILE = 'Y' AND
EXT_FILE.OWNER_ID = :PROFILE AND
EXT_FILE.ID = EXT_FILE_RES.EXT_ID AND
(RES_SUBSCRIBER_YN(EXT_FILE.ID,:CURR_ID) = 'YES' OR
ADMINYESNO(:CURR_ID,:PROFILE) = 'YES')
ORDER BY EXT_FILE.FILE_NAMEAnd here's the actual error message:
1 error has occurred
Query cannot be parsed within the Builder. If you believe your query is syntactically correct, check the ''generic columns'' checkbox below the region source to proceed without parsing. ORA-00904: "SER_IS_ADMINYESNO": invalid identifier -
How to pass a variable for a SQL query in OLEDB source?
Hi All,
I am new to SSIS and working on it past few days. Can anyone please help me getting through a scenario where I need to pass a variable in the SQL statement in OLEDB source connection. Please find below for the details.
eg:
1) I have a SQL table with the columns SerialNumber, Name, IsValid, FileName with multiple rows.
2) I have the file Name in a variable called Variable1.
3) I want to read the data from my SQL table filtering based on the FileName (Variable1) within a data flow task and pull that data to the destination table.
Question: In the data flow task, added source and destination DB connection with a script component in between to perform my validations. When trying to retrieve the data from source using the variable (i.e. SQL Query with variable), I am not able to add
the query as the SQL statement box is disabled. How to filter the data based on the variable in the source DB ?
Any help/suggestions would be of great help.
Thanks,
SriJust to add with Vaibhav comment .
SQL Command : SQL query either with SQL variable or any condition or simple Sql statement
Like ;
Select * from dimcustomer
SQL Command using Varible :
Sometimes we design our dynamic query in variable and directly use that variable name in oledb source.
If you Sql query needs a condition based on SSIS variable .
you can find a Example here :
http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2013/01/17/ssis-replace-dynamic-sql-with-variables.aspx
http://www.select-sql.com/mssql/how-to-use-a-variable-inside-sql-in-ssis-data-flow-tasks.html
Thanks
Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com -
Validation: more than one Other Source Dimension Member
Hi BPC Experts,
Is it possible to identify more than one Other Source Dimension Member in Validation Business Rules settings? For example, we need to use all DataSources that belong to IFRS roll up. If yes, what is the format?
Thanks.
MilaResolved. The format is DIMENSION=MEMBER OR DIMENSION=MEMBER.
For example,
C_DATASRC=MJ_MANJE OR C_DATASRC=GAAP_03 OR LOB_IFRS=TEST OR LOB_IFRS=IFRS_INSD. -
Not to able add sql query in the item source
Hi,
I am getting this error when i am trying to add the sql query in the item source
ORA-20505: Error in DML: p_rowid=3206911131098131, p_alt_rowid=ID, p_rowid2=, p_alt_rowid2=. ORA-01461: can bind a LONG value only for insert into a LONG column
SELECT
"UCL"
FROM
SELECT
TRUNC((
(SUM("EV FINAL" / 100) / COUNT("Object_Name") )
+
3 *
SQRT
(SUM("EV FINAL" / 100) * SUM("EV FINAL" / 100) ) / COUNT("Object_Name") -
(SUM("EV FINAL" / 100) / COUNT("Object_Name")) * (SUM("EV FINAL" / 100) / COUNT("Object_Name"))
),3) "UCL"
FROM
SELECT
Pro.Project_Name "Project Name",
POBJ.NAME "Object_Name",
TRUNC((
( ( NVL(AEV."Total Actual",0) - (NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ) )
DECODE(
(NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ),0,NULL,
(NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(ID."INCOMMING_DOC",0) ) ,0 ) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(D."DESIGN",0) ), 0 ) +
NVL( (NVL( (MAX(X."Build") / 100) ,0) * NVL(B."BUILD",0) ),0 ) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(T."TESTING",0) ),0 ) +
NVL( (NVL( (MAX(X."Release") / 100),0) * NVL(R."RELEASE",0) ),0 ) ) ) ) * 100),2)
|| '%' "EV_INITIAL",
TRUNC((
( (NVL(AEV."Total Actual",0) - ( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) )
DECODE(
( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) ,0,NULL,
( NVL( (NVL( (MAX(X."Incoming-Doc") / 100),0) * NVL(IDR."INCOMMING_DOC_REPLAN",0) ),0) +
NVL( (NVL( (MAX(X."Design") / 100),0) * NVL(DR."DESIGN_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Build")/100),0) * NVL(BR."BUILD_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Testing") / 100),0) * NVL(TR."TESTING_REPLAN",0)),0) +
NVL( (NVL( (MAX(X."Release")/100),0) * NVL(RR."RELEASE_REPLAN",0)),0) ) ) ) * 100),2) "EV FINAL",
TRUNC(BRV."RSV",2) "Revised SV"
FROM
PROJECTS PRO,
PROJECT_OBJECTS POBJ,
INITIAL_EFFORT IE,
SCHEDULE_VARIANCES SV,
INITIAL_EFFORT_VIEW IEV,
INCOMMING_DOC ID,
DESIGN D,
BUILD B,
TESTING T,
RELEASE R,
INCOMMING_DOC_REPLAN IDR,
DESIGN_REPLAN DR,
BUILD_REPLAN BR,
TESTING_REPLAN TR,
RELEASE_REPLAN RR,
ACTUAL_EFFORT_VIEW AEV,
REPLAN_INITIAL_EFFORT_VIEW RIEV,
BSV_RSV_VIEW BRV,
SELECT
distinct
pro.project_name "Project Name",
pobj.name "Object Name",
PRO.ID "PRO_ID",
POBJ.ID "POBJ_ID",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review') THEN
TO_CHAR('100')
WHEN
upper(ts.status) like upper('ACCEPTED') AND
tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review') THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review')
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Incoming-Doc",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
TO_CHAR('100')
WHEN
UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Design Review','Design - Review','TDD - Review')
THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Design Review','Design - Review','TDD - Review')
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Design",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
TO_CHAR('100')
WHEN
UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Build Review','Build - Review','Code - Review','Code')
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Build",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
TO_CHAR('100')
WHEN
UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Test Result Review','Test Result - Review','UTR - Review')
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Testing",
CASE
WHEN
ts.status in ('CLOSE','CLOSED','Closed') AND
tsk.name in ('Release-Review','Release - Verification',
'Migration & Release - Review') THEN
TO_CHAR('100')
WHEN
UPPER(ts.status) LIKE UPPER('ACCEPTED') AND
tsk.name in ('Release-Review','Release - Verification',
'Migration & Release - Review') THEN
TO_CHAR('75')
WHEN
ts.status IN ('RIP','WIP','REJECTED','Rejected') AND
tsk.name in ('Release-Review','Release - Verification','Migration & Release - Review') THEN
TO_CHAR('50')
WHEN
POBJ.ID IN (SELECT POBJ.ID FROM projects pro,project_objects pobj,task tsk,skip_phase sp,employees
emp,employee_project_pairs epp
WHERE pobj.pro_id = pro.id and epp.pro_id = pro.id AND sp.tas_id = tsk.id and
pobj.id = sp.OBJ_ID and pro.id = sp.pro_id
and tsk.name in ('Release-Review','Release - Verification','Migration & Release - Review' )
AND PRO.ID = :p2_projects ) THEN
TO_CHAR('100')
END "Release"
FROM
task_status ts,projects pro,project_objects pobj,task tsk
,employees emp,employee_project_pairs epp,REVIEW_ITEMS RI
WHERE
pobj.pro_id = pro.id
and pro.id = ts.pro_id
and pobj.id = ts.pro_obj_id
and tsk.id = ts.task_id
and emp.id = epp.emp_id
and epp.pro_id = pro.id
and ts.id = ri.ts_id
AND PRO.ID = :p2_projects
and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review','Design Review','Design - Review','TDD - Review',
'Build Review','Build - Review','Code - Review','Code',
'Test Result Review','Test Result - Review','UTR - Review',
'Release-Review','Release - Verification','Migration & Release - Review')
and ri.open_timestamp in
SELECT
distinct
max(ri.open_timestamp)
FROM
task_status ts,projects pro,project_objects pobj,task tsk
,employees emp,employee_project_pairs epp,REVIEW_ITEMS RI
WHERE
pobj.pro_id = pro.id
and pro.id = ts.pro_id
and pobj.id = ts.pro_obj_id
and tsk.id = ts.task_id
and emp.id = epp.emp_id
and epp.pro_id = pro.id
and ts.id = ri.ts_id
and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review','Design Review','Design - Review','TDD - Review',
'Build Review','Build - Review','Code - Review','Code',
'Test Result Review','Test Result - Review','UTR - Review',
'Release-Review','Release - Verification','Migration & Release - Review')
AND PRO.ID = :p2_projects
GROUP BY POBJ.NAME,TSK.NAME )
UNION
select
distinct
pro.project_name "Project Name",
pobj.name "Object Name",
PRO.ID "PRO_ID",
POBJ.ID "POBJ_ID",
case
when
tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review') THEN
TO_CHAR('100')
end "Incoming-Doc",
case
when
tsk.name in ('Design Review','Design - Review','TDD - Review') THEN
TO_CHAR('100')
end "Design",
case
when
tsk.name in ('Build Review','Build - Review','Code - Review','Code') THEN
TO_CHAR('100')
end "Build",
case
when
tsk.name in ('Test Result Review','Test Result - Review','UTR - Review') THEN
TO_CHAR('100')
end "Testing",
case
when
tsk.name in ('Release-Review','Release - Verification',
'Migration & Release - Review') THEN
TO_CHAR('100')
end "Release"
FROM
projects pro
,project_objects pobj
,task tsk
,skip_phase sp
,employees emp
,employee_project_pairs epp
WHERE
pobj.pro_id = pro.id
and epp.pro_id = pro.id
AND sp.tas_id = tsk.id
and pobj.id = sp.OBJ_ID
and pro.id = sp.pro_id
and tsk.name in ('Incomming-Doc Review','Incoming Doc- Review',
'Incoming Doc- Review','FDD - Review','Design Review','Design - Review',
'TDD - Review','Build Review','Build - Review','Code - Review','Code',
'Test Result Review','Test Result - Review','UTR - Review',
'Release-Review','Release - Verification','Migration & Release - Review')
and pro.id = :p2_projects ) X
WHERE
PRO.ID = POBJ.PRO_ID AND
PRO.ID = IE.PROJECT_NAME AND
UPPER(POBJ.NAME) = UPPER(IE.OBJECT_NAME) AND
PRO.ID = SV.PROJECT_NAME AND
UPPER(POBJ.NAME) = UPPER(SV.OBJECT_NAME) AND
PRO.ID = :p2_projects
AND PRO.ID = X."PRO_ID"
AND POBJ.ID = X."POBJ_ID"(+)
AND PRO.ID = IEV."PRO_ID"
AND POBJ.ID = IEV."POBJ_ID"
AND PRO.ID = ID."PRO_ID"
AND POBJ.ID = ID."POBJ_ID"
AND PRO.ID = D."PRO_ID"
AND POBJ.ID = D."POBJ_ID"
AND PRO.ID = B."PRO_ID"
AND POBJ.ID = B."POBJ_ID"
AND PRO.ID = T."PRO_ID"
AND POBJ.ID = T."POBJ_ID"
AND PRO.ID = R."PRO_ID"
AND POBJ.ID = R."POBJ_ID"
AND PRO.ID = IDR."PRO_ID"
AND POBJ.ID = IDR."POBJ_ID"
AND PRO.ID = DR."PRO_ID"
AND POBJ.ID = DR."POBJ_ID"
AND PRO.ID = BR."PRO_ID"
AND POBJ.ID = BR."POBJ_ID"
AND PRO.ID = TR."PRO_ID"
AND POBJ.ID = TR."POBJ_ID"
AND PRO.ID = RR."PRO_ID"
AND POBJ.ID = RR."POBJ_ID"
AND PRO.ID = AEV."PRO_ID"
AND POBJ.ID = AEV."POBJ_ID"
AND PRO.ID = RIEV."PRO_ID"
AND POBJ.ID = RIEV."POBJ_ID"
AND PRO.ID = BRV."PRO_ID"
AND POBJ.ID = BRV."POBJ_ID"
group by
PRO.PROJECT_NAME,
POBJ.NAME,
SV.status,
sv.comments,
ID."INCOMMING_DOC",D."DESIGN",B."BUILD",T."TESTING",R."RELEASE",
IDR."INCOMMING_DOC_REPLAN",DR."DESIGN_REPLAN",BR."BUILD_REPLAN",TR."TESTING_REPLAN",RR."RELEASE_REPLAN",
AEV."Total Actual",IEV."Total Plan",RIEV."Total Plan",
BRV."BSV",BRV."RSV",POBJ.Complexity,POBJ.PROGRAM_TYPE,pro.id,pobj.id,BRV."Status"
wht is the mistake i am doing here please suggets
thanks
SudhirCan you just setup an Excel/Essbase retrieval to get the data you need? You can't use SQL to query Essbase; here is a blog post that talks about it:
http://timtows-hyperion-blog.blogspot.com/2008/01/why-you-cant-use-sql-to-query-essbase.html
Since I made that post, I have found out that Essbase has now been integrated into the latest version of the Oracle BI Server and, technically, you could use SQL to query the data in Essbase via the Oracle BI Server if you have the right version.
Tim Tow
Applied OLAP, Inc -
Issue with SQL Query with Presentation Variable as Data Source in BI Publisher
Hello All
I have an issue with creating BIP report based on OBIEE reports which is done using direct SQL. There is this one report in OBIEE dashboard, which is written using direct SQL. To create the pixel perfect version of this report, I am creating BIP data model using SQL Query as data source. The physical query that is used to create OBIEE report has several presentation variables in its where clause.
select TILE4,max(APPTS), 'Top Count' from
SELECT c5 as division,nvl(DECODE (C2,0,0,(c1/c2)*100),0) AS APPTS,NTILE (4) OVER ( ORDER BY nvl(DECODE (C2,0,0,(c1/c2)*100),0)) AS TILE4,
c4 as dept,c6 as month FROM
select sum(case when T6736.TYPE = 'ATM' then T7608.COUNT end ) as c1,
sum(case when T6736.TYPE in ('Call Center', 'LSM') then T7608.CONFIRMED_COUNT end ) as c2,
T802.NAME_LEVEL_6 as c3,
T802.NAME_LEVEL_1 as c4,
T6172.CALENDARMONTHNAMEANDYEAR as c5,
T6172.CALENDARMONTHNUMBERINYEAR as c6,
T802.DEPT_CODE as c7
from
DW_date_DIM T6736 /* z_dim_date */ ,
DW_MONTH_DIM T6172 /* z_dim_month */ ,
DW_GEOS_DIM T802 /* z_dim_dept_geo_hierarchy */ ,
DW_Count_MONTH_AGG T7608 /* z_fact_Count_month_agg */
where ( T802.DEpt_CODE = T7608.DEPT_CODE and T802.NAME_LEVEL_1 = '@{PV_D}{RSD}'
and T802.CALENDARMONTHNAMEANDYEAR = 'July 2013'
and T6172.MONTH_KEY = T7608.MONTH_KEY and T6736.DATE_KEY = T7608.DATE_KEY
and (T6172.CALENDARMONTHNUMBERINYEAR between substr('@{Month_Start}',0,6) and substr('@{Month_END}',8,13))
and (T6736.TYPE in ('Call Center', 'LSM')) )
group by T802.DEPT_CODE, T802.NAME_LEVEL_6, T802.NAME_LEVEL_1, T6172.CALENDARMONTHNAMEANDYEAR, T6172.CALENDARMONTHNUMBERINYEAR
order by c4, c3, c6, c7, c5
))where tile4=3 group by tile4
When I try to view data after creating the data set, I get the following error:
Failed to load XML
XML Parsing Error: mismatched tag. Expected: . Location: http://172.20.17.142:9704/xmlpserver/servlet/xdo Line Number 2, Column 580:
Now when I remove those Presention variables (@{PV1}, @{PV2}) in the query with some hard coded values, it is working fine.
So I know it is the PV that's causing this error.
How can I work around it?
There is no way to create equivalent report without using the direct sql..
Thanks in advanceI have found a solution to this problem after some more investigation. PowerQuery does not support to use SQL statement as source for Teradata (possibly same for other sources as well). This is "by design" according to Microsoft. Hence the problem
is not because different PowerQuery versions as mentioned above. When designing the query in PowerQuery in Excel make sure to use the interface/navigation to create the query/select tables and NOT a SQL statement. The SQL statement as source works fine on
a client machine but not when scheduling it in Power BI in the cloud. I would like to see that the functionality within PowerQuery and Excel should be the same as in Power BI in the cloud. And at least when there is a difference it would be nice with documentation
or more descriptive errors.
//Jonas -
Repair Problem with Excel Removing All But First External SQL Query Tables
We have an Excel 2007 XLSX workbook that we created for doing some business analysis from the SQL database that contains data from our MRP system. It started as a single sheet with one data connection running a SQL query. The data comes into
the spreadsheet as a table and there are some basic row and column sums being done.
After getting the first version up and running without problems, we decided to add some additional sheets to the same workbook. Since each of these additional sheets had only slight variations to the SQL query and the formatting was all to be the same, we
simply copied the first sheet and modified the data connection for each successive sheet (each copy automatically created a copy of the data connection as well). Everything seemed to be up and running properly, so we saved and closed the workbook.
A little bit later, the same workbook was re-opened and Excel reported that "Excel found unreadable content in '<file name>'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes." If Yes
is clicked, then Excel indicates the repairs that were made. Only one was made for each sheet beyond the first and that was "Removed Part: /xl/queryTables/queryTable2.xml part. (External data range)". The result was that the data connection
was deleted from every sheet other than the first and only static data left in place.
We thought it might have actual been some corruption, so we deleted the static sheets and recreated them the same way. After saving and closing, re-opening the file resulted in the same problem. It seems that Excel is somehow saving data that it can't read
when it opens. I would think it could be something in the SQL query, but all sheets have essentially the same SQL query, so I'm not sure why the first sheet survives. As a result, I think it must be something that it does in copying the sheet and the corresponding
data connections, but I'm not sure.
I think this might be some kind of bug, but would like to know if anyone else has encountered a similar problem and found a solution. A few internet searches didn't give me much to check out.
Thanks in advance,
indyvqlKR,
Thanks for your response. I don't think it applies in this case since the file was created brand new in Excel 2007 and used in the same. There was no 3rd-party program involved. I'm also not migrating from 2003 to 2010 as the stellarinfo.com article
suggests. Some of the other suggestions there also don't make any difference as all the data links are lost on opening the worksheet, so copying and pasting doesn't do any good.
I tried to create a simple example by creating a new workbook with a sheet with a very simple SQL query ("select * from X where a > b"), but in that example it worked fine. I'm guessing there is something key about the much more complex SQL query
in my original file with the problem, but I'm not sure why it would only affect copies of the data connection and not the original data connection itself.
Thanks,
indyvql -
[Excel] Running a SQL Query to delete rows
Hello Experts,
Background: I am attempting to use a dba of my companies time keeping system and implement it with Power BI tools. Given the file size restrictions within Power Bi itself I need to lower my file size by removing all time logs from
inactive employees.
I have a question regarding whether or not you can use a sql query to delete rows in excel. I have roughly 200,000+ rows in my excel spreadsheet. I am attempting to delete all rows where an employee equals inactive. I have attempted to
delete these rows by sorting them and doing a bulk delete and clear contents, but it seems to crash my excel every time. My thought process is that using a query that does a timed delete might put less of a burden on deleting the massive amount of data.
I would like to use this: DELETE * FROM [Table_(...)_Actual$] WHERE [Current] = "Inactive" (Will add more once I know it is possible to use sql queries in Excel.
Any information on whether or not this is possible would be appreciated.
Regards,
LinkRunning SQL Query in Excel is possible, however, the delete query is not supported in Excel.
You are more restricted in deleting Excel data than data from a relational data source. In a relational database, "row" has no meaning or existence apart from "record"; in an Excel worksheet, this is not true. You can delete values
in fields (cells). Please see:http://support.microsoft.com/kb/257819/en-us
One workaround : Use update query to set the rows as null, then use select query.
e.g.
SQL = "update [sheet2$A1:B5] set name=null,age=null where name='andy'"
cnn.Execute SQL
SQL = "select name,age from [sheet2$A1:B5] where name is not null"
Wind Zhang
TechNet Community Support -
Excel ADODB Sql Query Execution taking hours when manipulate excel tables
Hello All
I have 28000 records with 8 column in an sheet. When I convert the sheet into ADODB database and copy to new
excel using below code it is executing in less than a min
Set Tables_conn_obj = New ADODB.Connection
Tables_conn_str = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Table_Filename & ";Extended Properties=""Excel 12.0;ReadOnly=False;HDR = Yes;IMEX=1"""
Tables_conn_obj.Open Tables_conn_str
First_Temp_sqlqry = "Select * INTO [Excel 12.0;DATABASE=C:\Prod Validation\Database\Second Acat Table.xlsb].[Sheet1] Table [first - Table$];" Tables_conn_obj.Execute First_Temp_sqlqry
But when I change the query to manipulate one column in current table based on another table in the same excel
and try to copy the results in another excel, it is taking more than one hour.. why it is taking this much time when both the query results returns the same number of rows and column. I almost spend one week and still not able to resolve this issue.
Even I tried copyfromrecordset, getrows(), getstring(), Looping each recordset fields options all of them taking
same amount of time. Why there is huge difference in execution time.
Important note: Without into statement even below query is executing in few seconds.
select ( ''''''manipulating first column based on other table data''''''''''''''
iif(
[Second - Table$].[Policy Agent] = (select max([ACAT$].[new_Agent_number]) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] > '2014-10-01') ) , (select max([ACAT$].[Old_Agent_number]) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] > '2014-10-01')) ,
iif( [Second - Table$].[Policy Agent] = (select max([ACAT$].[Old_Agent_number]) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$]where [ACA T$].[Old_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] <= '2014-10-01') ), (select max([ACAT$].[new_Agent_number]) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] <= '2014-10-01')) ,
[Second - Table$].[Policy Agent] ))) as [Policy Agent],
''''''summing up all other columns''''''''''''''
(iif(isnull(sum([Second - Table$].[Auto BW-Line Of Business Detail])),0,sum([Second - Table$].[Auto BW-Line Of Business Detail]))) as [Auto BW-Line Of Business Detail],(iif(isnull(sum([Second - Table$].[Auto Farmers])),0,sum([Second - Table$].[Auto Farmers]))) as [Auto Farmers],(iif(isnull(sum([Second - Table$].[MCA])),0,sum([Second - Table$].[MCA]))) as [MCA],(iif(isnull(sum([Second - Table$].[CEA])),0,sum([Second - Table$].[CEA]))) as [CEA],(iif(isnull(sum([Second - Table$].[Commercial P&C])),0,sum([Second - Table$].[Commercial P&C]))) as [Commercial P&C],(iif(isnull(sum([Second - Table$].[Comm WC])),0,sum([Second - Table$].[Comm WC]))) as [Comm WC],(iif(isnull(sum([Second - Table$].[Fire Farmers])),0,sum([Second - Table$].[Fire Farmers]))) as [Fire Farmers],(iif(isnull(sum([Second - Table$].[Flood])),0,sum([Second - Table$].[Flood]))) as [Flood],(iif(isnull(sum([Second - Table$].[Kraft Lake])),0,sum([Second - Table$].[Kraft Lake]))) as [Kraft Lake],(iif(isnull(sum([Second - Table$].[Life])),0,sum([Second - Table$].[Life]))) as [Life],(iif(isnull(sum([Second - Table$].[Foremost])),0,sum([Second - Table$].[Foremost]))) as [Foremost],(iif(isnull(sum([Second - Table$].[Umbrella])),0,sum([Second - Table$].[Umbrella]))) as [Umbrella],(iif(isnull(sum([Second - Table$].[MCNA])),0,sum([Second - Table$].[MCNA]))) as [MCNA]
INTO [Excel 12.0;DATABASE=C:\Prod Validation\Database\Second Acat Table.xlsb].[Sheet1]
from [Second - Table$] group by [Second - Table$].[Policy Agent] ;Hi Fei,
Thank you so much for the reply post. I just executed the same above SQL without INTO Statement and assigned the SQL result to ADODB recordset as below. If the time difference is due to the SQL query then below statements also should execute for hours
right, but it gets executed in seconds. But to copy the recordset to excel again it is taking hours. I tried copyfromrecordset,
getrows(), getstring(), Looping each recordset fields options and all of them taking same amount of time. Please let me know there is delay in time for this much small data
Even I tried to typecast all columns to double, string in SQL and still the execution time is not reduced.
First_Temp_Recordset.Open sql_qry, Tables_conn_obj, adOpenStatic, adLockOptimistic ''' OR SET First_Temp_Recordset = Tables_conn_obj.Execute sql_qry -
Excel ADODB Sql Query Execution taking hours when manipulate excel tables why?
I have 28000 records with 8 column in an sheet. When I convert the sheet into ADODB database and copy to new excel using below code it is executing in less than a min
Set Tables_conn_obj = New ADODB.Connection Tables_conn_str = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Table_Filename & ";Extended Properties=""Excel 12.0;ReadOnly=False;HDR = Yes;IMEX=1""" Tables_conn_obj.Open
Tables_conn_str First_Temp_sqlqry = "Select * INTO [Excel 12.0;DATABASE=C:\Prod Validation\Database\Second Acat Table.xlsb].[Sheet1] Table [first - Table$];" Tables_conn_obj.Execute First_Temp_sqlqry
But when I change the query to manipulate one column in current table based on another table in the same excel and try to copy the results in another excel, it is taking more than one hour.. why it is taking this much time when both the query results returns
the same number of rows and column. I almost spend one week and still not able to resolve this issue.
Even I tried copyfromrecordset, getrows(), getstring(), Looping each recordset fields options all of them taking same amount of time. Appreciate any inputs...
select ( ''''''manipulating first column based on other table data''''''''''''''
iif( [Second - Table$].[Policy Agent] = (select max([ACAT$].[new_Agent_number]) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where
[ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] > '2014-10-01') ) , (select max([ACAT$].[Old_Agent_number]) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate]
= ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[new_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] > '2014-10-01')) ,
iif( [Second - Table$].[Policy Agent] = (select max([ACAT$].[Old_Agent_number]) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate] = ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$]where
[ACA T$].[Old_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] <= '2014-10-01') ), (select max([ACAT$].[new_Agent_number]) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent] and [ACAT$].[ACAT_EffectiveDate]
= ( select MAX([ACAT$].[ACAT_EffectiveDate] ) from [ACAT$] where [ACAT$].[Old_Agent_number] = [Second - Table$].[Policy Agent]and [ACAT$].[ACAT_EffectiveDate] <= '2014-10-01')) ,
[Second - Table$].[Policy Agent] ))) as [Policy Agent],
''''''summing up all other columns''''''''''''''
(iif(isnull(sum([Second - Table$].[Auto BW-Line Of Business Detail])),0,sum([Second - Table$].[Auto BW-Line Of Business Detail]))) as [Auto BW-Line Of Business Detail],(iif(isnull(sum([Second - Table$].[Auto Farmers])),0,sum([Second - Table$].[Auto Farmers])))
as [Auto Farmers],(iif(isnull(sum([Second - Table$].[MCA])),0,sum([Second - Table$].[MCA]))) as [MCA],(iif(isnull(sum([Second - Table$].[CEA])),0,sum([Second - Table$].[CEA]))) as [CEA],(iif(isnull(sum([Second - Table$].[Commercial P&C])),0,sum([Second
- Table$].[Commercial P&C]))) as [Commercial P&C],(iif(isnull(sum([Second - Table$].[Comm WC])),0,sum([Second - Table$].[Comm WC]))) as [Comm WC],(iif(isnull(sum([Second - Table$].[Fire Farmers])),0,sum([Second - Table$].[Fire Farmers]))) as [Fire
Farmers],(iif(isnull(sum([Second - Table$].[Flood])),0,sum([Second - Table$].[Flood]))) as [Flood],(iif(isnull(sum([Second - Table$].[Kraft Lake])),0,sum([Second - Table$].[Kraft Lake]))) as [Kraft Lake],(iif(isnull(sum([Second - Table$].[Life])),0,sum([Second
- Table$].[Life]))) as [Life],(iif(isnull(sum([Second - Table$].[Foremost])),0,sum([Second - Table$].[Foremost]))) as [Foremost],(iif(isnull(sum([Second - Table$].[Umbrella])),0,sum([Second - Table$].[Umbrella]))) as [Umbrella],(iif(isnull(sum([Second - Table$].[MCNA])),0,sum([Second
- Table$].[MCNA]))) as [MCNA]
INTO [Excel 12.0;DATABASE=C:\Prod Validation\Database\Second Acat Table.xlsb].[Sheet1]
from [Second - Table$] group by [Second - Table$].[Policy Agent] ;Hi Fei,
Thank you so much for the reply post. I just executed the same above SQL without INTO Statement and assigned the SQL result to ADODB recordset as below. If the time difference is due to the SQL query then below statements also should execute for hours
right, but it gets executed in seconds. But to copy the recordset to excel again it is taking hours. I tried copyfromrecordset,
getrows(), getstring(), Looping each recordset fields options and all of them taking same amount of time. Please let me know there is delay in time for this much small data
Even I tried to typecast all columns to double, string in SQL and still the execution time is not reduced.
First_Temp_Recordset.Open sql_qry, Tables_conn_obj, adOpenStatic, adLockOptimistic ''' OR SET First_Temp_Recordset = Tables_conn_obj.Execute sql_qry -
Power Query for Excel - Need Help with Oracle SQL Syntax
Hello everyone,
I am new to Power Query and am not able to figure this out. I am trying to pull in data into my Excel spreadsheet using a specific Oracle SQL query. While in query editor, how do I take the Oracle.Database function and add my SQL statement?
I already know what I want, I don't want it to download all the table names. According to the help page, I should be able to do this but it does not provide a syntax example
Also, I don't understand what "optional options as nullable record" means.
Below is what function and arguments the help page notes. How do I use this?
Oracle.Database(server as text, optional options as nullable record) as table
Any help is greatly appreciated.
Thank you,
JessicaWhen I try this, I get an error
DataSource.Error: Oracle: Sql.Database does not support the query option 'Query' with value '"Select * from Owner.View_Name"'. Details: null
I'm trying to download oracle data from a view into power query - Power Query navigator does not list th eviews from my source, it lists only the tables. When I try write sql statements, it throws me the above
error. This is what I tried
Oracle.Database("Source/Service",[Query="Select * from Owner.View_Name"])
Any ideas how to fix this? -
3010 : 07001 : java.sql.SQLException: [Microsoft][ODBC Excel Driver] Too few parameters. Expected 4.
java.sql.SQLException: [Microsoft][ODBC Excel Driver] Too few parameters. Expected 4.
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(Unknown Source)
at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlC.treatTaskTrt(SnpSessTaskSqlC.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.i(e.java)
at com.sunopsis.dwg.cmd.h.y(h.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source)
ANY solutions?thanks to the friends in another forum..i could identify the reason..
http://www.thatsjava.com/jdbc/77269/
regards
B -
Need SQL Query which saves query results to an excel file
Hi,
I am looking for a sql query which saves/ export results of an query to a excel file
Thanks,
ChetanI am looking for a sql query which saves/ export results of an query to a excel file
Thanks,
Chetan
Options:
1) You can use
BCP command to export result to excel
2) Insert into excel by using OPENROWSET
3) Use Import and Export Wizard and provide SQL query as source and Excel as destination
Please refer:
http://stackoverflow.com/questions/87735/how-do-you-transfer-or-export-sql-server-2005-data-to-excel
http://www.codeproject.com/Questions/617527/Export-sql-query-result-in-excel-file
Cheers,
Vaibhav Chaudhari
[MCTS],
[MCP] -
Export to Excel from Report region (pl/sql returning sql query)
Hello all,
I have encountered an interesting problem. I have an HTMLDB application with a lot of sql reports coded straight inside the report region. In order to better organize my reports, I decided to
1. make all my report regions of type "Pl/Sql function returning SQL query"
2. create a package inside my database schema which houses all reports as pl/sql functions returning VARCHAR2, the string returned being the report query
3. just calling "return package_name.function_name" from inside my report region of type "Pl/sql function returning SQL query".
This technique seemed to work perfectly. The reports were being returned as expected. I was then asked to provide the "Export to Excel" capability to all my reports. This seemed like a piece of cake using HTML DB's "Export to Excel" extension. However, the "export to excel" does not function correctly when my reports are inside a package in the database. HTML DB tries to export but inside the excel spreadsheet, instead of seeing row data, I see:
<pre>failed to parse SQL query:
ORA-00936: missing expression
<!-- select a.username, b.table_name, 'View Row Data' from schema_browser_user_list a, all_tables b where a.user_id = and a.username = b.owner order by b.table_name asc
--!>
</pre>
I am building my query string inside of my package functions by using a combination of literal strings and concatenating them with some parameter values being passed in. It seems that the HTML DB engine which exports the report to excel does not properly understand the concatenation of variables as can be seen by the empty space to the right of the equal sign in the "a.user_id = " clause. Does anybody have any input as to whether this is a known issue or if I am doing something wrong? Thanks a lot for your time.
- Kenny R.James,
Thanks for the quick reply. I think you mis-understood what I'm doing. All I'm doing is creating packaged functions which return VARCHAR2. The VARCHAR2 that they return is the report query. With this technique, I no longer have to type the query into the HTML DB report region. Instead, I make the report region a "Pl/sql function returning sql query" and make the following call: return package_name.function_name(some_application_items passed in as parameters)
This makes for a much more organized html db app. The problem is that the "export to excel" function does not correctly interpret the VARCHAR2 that my packaged functions are returning. Is this a better explanation? Thanks again for your time.
- Kenny R.
Maybe you are looking for
-
Options greyed out in the main Garage Band toolbar tab
I hadn't noticed that earlier but when I clicked it I saw this!!! (look at the pic) I have had a serious issue with Garage Band recently: it opens with a considerable delay (up to several minutes) and isn't showing up in Mission Control regardless of
-
JPA error with Jdev 11g and 3.6 server
I am testing a sample JPA demo I found on OTN and I am running into an issue when I start a coherence instance in a command window and run the sample code within jdev. If I run this example in Jdev with out starting the extra instance it will run cor
-
Hello, I have received a Zen Touch, and I plugged it in to charge it for the first time, but no battery meter appears to tell me how it is charging. When I turn it on while it is plugged in, the icon at the upper left is the plug only, which means th
-
Report with highlighting position - on click
I have a Form with a Report page on which report part contains a large number of rows. This report is using standard template – 13. Now users would like to be able to click on a row an it should be either highlighted or changing color. This click is
-
Itunes says i dont have enough memory, even though i do
I deleted tonns of music off my iTunes, and when I decided to sync my iPhone, it told me I didn't have enough memory - even though I was syncing less stuff than what was already on the device. I originally had about 1000 photos synced to my iphone fr