Performance of APD with source as 'Query with conditions'
Hi,
I have a question regarding the performance of an APD query with conditions when it is run in the background.
I have an infocube with 80 million records.I have a query to find Top 15 (Condition In query) Customers per territory.
With the help of an APD Query (Source) i wanted to populate the details (customer category , etc) of the Top 15 Customers into a DSO (Target)
Right now it takes 6 minutes to run the query in web.
I wanted to know how feasible it is to use an APD (run in backgrnd) to dump the results of the BEx query (which has conditions Top 15) into DSO.
Also , what other options do i have ?
Appreciate your answers.
Regards
Thomas thanks for the response. I have checked the file on the app server and found that the lines with more than 512 characters are being truncated after 512 characters. Basis team is not aware of any such limits on the app server. I am sure few on the forum would have extracted data to a file on the application server using APD. Please note that the file extraction to the client workstation is working as expected (posts lines more than 512 characters).
Similar Messages
-
OLEDB Source sql query with parameter
I have a dataflow in a for each loop container.The OLEDB Source is pointing to oracle database.The sql query to fetch the data should take a variable value.
Example : select * from tablename where colname = @variablevalue
the variable value changes each time since the dataflow is in a for each loop container.
can anyone please help me configuring the source??
when i try to use ? i get the following error message
Thanks,
RahulI can't troubleshoot that error as i don't have a Oracle source to test. See this -
http://microsoftdw.blogspot.com/2005/11/parameterized-queries-against-oracle.html
Try -
1. Create a int variable vBatchIndex (this would be your parameter which you are trying to pass) and provide the value
2. Create another string variable vSQLQuery > Go to Variable properties > Set the "EvaluateAsExpression" property to "True"
3. Under the variable properties > Go to Expression > and provide this expression as
"SELECT * FROM fc_batch_report WHERE batch_index= " + (DT_WSTR, 10) @[User::vBatchIndex]
4.Next ,go to OLE DB Source > Select the Data access mode - SQL command from variable
5.Select the variable name - vSQLQuery
Narsimha -
Need help with writing a query with dynamic FROM clause
Hi Folks,
I need help with an query that should generate the "FROM" clause dynamically.
My main query is as follows
select DT_SKEY, count(*)
from *???*
where DT_SKEY between 20110601 and 20110719
group by DT_SKEY
having count(*) = 0
order by 1; The "from" clause of the above query should be generated as below
select 'Schema_Name'||'.'||TABLE_NAME
from dba_tables
where OWNER = 'Schema_Name'Simply sticking the later query in the first query does not work.
Any pointers will be appreciated.
Thanks
rogers42Hi,
rogers42 wrote:
Hi Folks,
I need help with an query that should generate the "FROM" clause dynamically.
My main query is as follows
select DT_SKEY, count(*)
from *???*
where DT_SKEY between 20110601 and 20110719
group by DT_SKEY
having count(*) = 0
order by 1; The "from" clause of the above query should be generated as below
select 'Schema_Name'||'.'||TABLE_NAME
from dba_tables
where OWNER = 'Schema_Name'
Remember that anything inside quotes is case-sensitive. Is the owner really "Schema_Name" with a capital S and a capital N, and 8 lower-case letters?
Simply sticking the later query in the first query does not work.Right; the table name must be given when you compile the query. It's not an expression that you can generate in the query itself.
Any pointers will be appreciated.In SQL*Plus, you can do something like the query bleow.
Say you want to count the rows in scott.emp, but you're not certain that the name is emp; it could be emp_2011 or emp_august, or anything else that starts with e. (And the name could change every day, so you can't just look it up now and hard-code it in a query that you want to run in the future.)
Typically, how dynamic SQL works is that some code (such as a preliminary query) gets some of the information you need to write the query first, and you use that information in a SQL statement that is compiled and run after that. For example:
-- Preliminary Query:
COLUMN my_table_name_col NEW_VALUE my_table_name
SELECT table_name AS my_table_name_col
FROM all_tables
WHERE owner = 'SCOTT'
AND table_name LIKE 'E%';
-- Main Query:
SELECT COUNT (*) AS cnt
FROM scott.&my_table_name
;This assumes that the preliminary query will find exactly one row; that is, it assumes that SCOTT has exactly one table whose name starts with E. Could you have 0 tables in the schema, or more than 1? If so, what results would you want? Give a concrete example, preferably suing commonly available tables (like those in the SCOTT schema) so that the poepl who want to help you can re-create the problem and test their ideas.
Edited by: Frank Kulash on Aug 11, 2011 2:30 PM -
Problem with input ready query with structure in Rows
Hi,
First I have created an input ready query without a structure where I have GL accounts in rows and key figures in column. It works and I can see that the cells are ready for input when I launch it in web through query designer.
Later, I am replacing the GL accounts in rows with a structure. Each line in the structure is combination of GL acctUoMChart of Acct (all restrcited to single values). Here comes the issue. When I run the query again (launching thru query designer) it dumps. Any idea?
Also, please let me know whether the planning applications can be made using BEX analyser OR WAD ?
Thanks a lot in advance.
Regards,
SSC
Edited by: sapsem con on Feb 19, 2009 2:38 PMHi,
Can you check ST22 for the dump analysis.
Also, planning applications can be built using BEx analyzer or WAD.
Check this link for example and step-by-step procedure to do the same.
http://help.sap.com/saphelp_nw70/helpdata/en/43/a18462c8291d9be10000000a1553f7/frameset.htm
Regards,
Deepti -
Help with filtering a query with a date as string column
Hello -- I've got a table column that contains dates as
string/text type (access db). I need to make a query of my table
that includes only the dates that match today's date (example
5-13-2008). I need two parts. One is to capture today's date, and
another to set the filter in the query.
Here's my base query
<cfquery name="someQuery" datasource="someDS">
SELECT col1, col2, dateCol, col4
FROM someTable
WHERE dateCol = "today's date"
</cfquery>
What's the best way to capture today's date? And then what's
the best way to set it to a string so I have an object to compare
with dateCol. I know #now()# will get today's date, however it
returns date + time. How can I format it as M-D-YYYY? Then, how do
I convert it to a string so I can evaluate in my query? Any help is
appreciated!quote:
Originally posted by:
Dan Bracuk
Redesign your database and store dates as dates instead of
strings.
I would love to do this, however I couldn't figure out how to
store date and time values AS DATE to my database. My front end is
Flex with a Coldfusion backend. When a form is filled, I need it to
send the current time and the current date of submission. Using
Date(), I can obtain the current date (date + time). However it's
not easy to separate the [date] and [time] values of the Date()
result without using a dateformatter with a mask. By doing this,
I've now taken my date as DATE and converted it to date and time
both AS STRING. Well after several trial and error tries as well as
looking for any help online, I just decided to use the
dateformatter, convert date and time to string and then save each
to their own columns.
The other way of doing this is to just have one column that
holds both the date and time, and use Date() to pass the correct
data-type to my db. However, when passing Date() to my db, it only
stores the date but sets the time to 00:00:00. Now if I could find
a way to get both correct date and time (example 5-13-2008 1:31:xx
PM), I could just use a dateformatter in my front end to display
the dates as I want. Again, the problem is I need the TIME value as
well, and it keeps defaulting to 00:00:00 in access.
@paross1-- I will try what you've provided just to get this
thing working, regardless if they are strings in the db instead of
dates.
If anyone can solve my default time issue mentioned above,
that would be great too.. -
Need help with group by query with condition
Name
ID
A1
1
A2
1
A3
1
A1
1
A2
2
A2
3
A3
3
A1
4
A2
4
A3
5
I want to get result of total count where ID is less than 4
A1 - 2
A2 - 3
A3 - 2Hi,
If you want to get 0 counts for names that don't have any low ids, then use a CASE expression instead of a WHERE clause.
You didn't post CREATE TABLE and INSERT statements for your sample data, so I'll use scott.emp to illustrate.
Say you want to see how many sals in each job are under 3000, like this:
JOB UNDER_3_CNT
CLERK 4
SALESMAN 4
PRESIDENT 0
MANAGER 3
ANALYST 0
Here's one way to do that:
SELECT job
, COUNT (CASE WHEN sal < 3000 THEN 1 END) AS under_3_cnt
FROM scott.emp
GROUP BY job
This shows that there are ANALYSTs and PRESIDENTs in the scott.emp table; there just don't happen to be any with sals under 3000. -
0equipment_attr query with respect to 0calyear
Dear all,
i need to make a query showing number of equipments, i use infoprovider 0equipment, however, i need to get records with respect to 0calyear. Is it possible with making a query with 0equipment and how?
thanks.Hi thanks for the reply,
i guess i should use 0date or 0date_from and fill 0calyear from this field.
Where i am confused is when i upload data in 0equipment_attr, it overwrites all fields with new values.
i need to develop a report as follows:
calyear equipment number total capacity
2008 12 23500
2007 11 19000
can it be possible?
thanks -
APD using Query with multiple structures as a data source
All,
I want to set up an automatic process which executes a query and exports it to a shared drive as a csv file. I have tried various options , when I try to use APD to set up the extract, I get an error and this is because the query that I am trying to use has Strucutres in both rows and columns. Hence, I am unable to use this option. I tried RSCRM_BAPI, It works well, but there is an issue with scheduling this in Process chain. I created an event and scheduled this as a job to trigger after "event" as per SAP instructions, but the job does not exist and it is not possible to trigger it through the Process chain unless the variables are hard coded in the query which I do not want to do.
Can any one tell me if there is a way to deal with APD using Query with multiple structures?
Would really appreciate if some one can give me the right solution...
ThanksHi Tanu ,
APD is an option but its not very good with large amount of data or hiearachies or if you have attributes in you query structure .
One more option for this requirement is use of report program using function module RRW3_GET_QUERY_VIEW_DATA .
This will work fine with multiple structure etc .
There are some overheads with this FM ex: if amount of data is too much then program will give dump .Solution for that is we call the FM in LOOP by diving amount of data need to be fetched .ex: we can read data quarter wise.
For using this function module what you can do is write an ABAP program (At SE38 ) .which will call this FM and then write the output into a flat file which you can save at application server (AL11) .From there other system can read it .
To automate this whole process you can further add all the report programs into a process chain (RSPC) which can be schedule as per requirement .
To pass input parameters you can use variants that will pass the values to the report .
Check thi link for sample code :
[http://www.tricktresor.de/content/index.php?navID=696&aID=496]
Hope this will be helpful .
Regards,
Jaya Tiwari -
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 -
Performance issue after Upgrade from 4.7 to ECC 6.0 with a select query
Hi All,
There is a Performance issue after Upgrade from 4.7 to ECC 6.0 with a select query in a report painter.
This query is working fine when executed in 4.7 system where as it is running for more time in ECC6.0.
Select query is on the table COSP.
SELECT (FIELD_LIST)
INTO CORRESPONDING FIELDS OF TABLE I_COSP PACKAGE SIZE 1000
FROM COSP CLIENT SPECIFIED
WHERE GJAHR IN SELR_GJAHR
AND KSTAR IN SELR_KSTAR
AND LEDNR EQ '00'
AND OBJNR IN SELR_OBJNR
AND PERBL IN SELR_PERBL
AND VERSN IN SELR_VERSN
AND WRTTP IN SELR_WRTTP
AND MANDT IN MANDTTAB
GROUP BY (GROUP_LIST).
LOOP AT I_COSP .
COSP = I_COSP .
PERFORM PCOSP USING I_COSP-_COUNTER.
CLEAR: $RWTAB, COSP .
CLEAR CCR1S .
ENDLOOP.
ENDSELECT.
I have checked with the table indexes, they were same as in 4.7 system.
What can be the reson for the difference in execution time. How can this be reduced without adjusting the select query.
Thanks in advance for the responses.
Regards,
Dedeepya.Hi,
ohhhhh....... lots of problems in select query......this is not the way you should write it.
Some generic comments:
1. never use SELECT
endselect.
SELECT
into table
for all entries in table
where.
use perform statment after this selection.
2. Do not use into corresponding fields. use exact structure type.
3. use proper sequence of fields in the where condition so that it helps table go according to indexes.
e.g in your case
sequence should be
LEDNR
OBJNR
GJAHR
WRTTP
VERSN
KSTAR
HRKFT
VRGNG
VBUND
PARGB
BEKNZ
TWAER
PERBL
sequence should be same as defined in table.
Always keep select query as simple as possible and perform all other calculations etc. afterwords.
I hope it helps.
Regards,
Pranaya -
Improve performance of query with order by
Hello,
I have a query with a necessary "order by" which lasts 24 seconds. The same query without the "order by" lasts 1 second.
How can I improve the performance of the query with "order by"?
Thank you very much.
The query is:
select distinct CC.acceso,CC.ext_acceso,TIT.TITULO_SALIDA
from (((Ocurrencias CT01 inner join
palabras p0 on (CT01.cod_palabra = p0.cod_palabra and p0.palabra like 'VENEZUELA%' AND p0.campo = 'AUTOR')) INNER JOIN
CENTRAL CC ON (CT01.ACCESO = CC.ACCESO AND CT01.EXT_ACCESO = CC.EXT_ACCESO))) inner join
codtit ctt on (CC.acceso = ctt.acceso and CC.ext_acceso = ctt.ext_acceso) inner join
titulos tit on (ctt.cod_titulo = tit.cod_titulo and ctt.portada = '1')
where CC.nivel_reg <> 's'
ORDER BY 3 ASC;My guess is SQL Scratchpad is a GUI and is not returning all the rows but just the first screenful. Without any order by or distinct the database can start returning rows as soon as it finds the first one. With an order or distinct it needs to sort the rows so the first row can only be returned after the last row is retrieved.
Open a command line prompt and run
sqlplus
SQL> set timing on
SQL>And then run your queries.
If you still have a large discrepancy do this
SQL> set autotrace traceonly
SQL>And then run the queries and post the output. -
I am using a query which has two structures within APD and got an error during activation.
I found OSS note 751577 which explains the workaround for queries with two structures, even though I added additional columns as suggested in the note I am still getting the error message during activation.
Let me know if anyone was able to get queries with two structure working with APD.
Thanks!
-DeepuHi Thomas,
I have a query with 2 structures. Note 751577,
The Analysis Process Designer supports only queries with one structure, the structure for key figures.
Check whether your query includes two structures.
If it does, the following workaround is available: Multiply the number of rows by the number of columns.
If a query has four rows and five columns, you must create twenty columns, for example, to make a permitted query available.
I tried this workaround as mentioned but still end up getting the same error msg.
Could you please help me?
Regard,
Rohit
Edited by: rohitmulay on Mar 31, 2011 7:00 AM -
I guys
I have a query with estructure and selection, but when use this query in the process APD how datasource, show the next issue...
The technical field name KYF_0001 for field 48PZJIN0JCKGZKDDE2NCD3WUA may only appear once per input or output structure
Technical key for message: CX_RSAN_SVC_CHECK_ANALYSIS_N=>NODE_FIELDNAME_NOT_U
I saw the name´s of each element in the APD process and have two elements with the same name KYF_0001, but I don´t know where changue these.
Thanks by your helpHi Marcos,
well, there are some restrictions when using a query in APD. Please see note 751577 for details. A query needs to have one structure (namely for keyfigures) only. APD tries to generate a table with columns just on basis of the query definition, i.e. a fixed table structure. Hence, the drill down is put into the rows. And in the drill down, only characteristics are allowed, not structure members.
Cheers,
Thomas -
Performance issue with the Select query
Hi,
I have an issue with the performance with a seclet query.
In table AFRU - AUFNR is not a key field.
So i had selected the low and high values into s_reuck and used it in Where condition.
Still i have an issue with the Performance.
SELECT SINGLE RUECK
RMZHL
IEDD
AUFNR
STOKZ
STZHL
FROM AFRU INTO table t_AFRU
FOR ALL ENTRIES IN T_ZSCPRT100
WHERE RUECK IN S_RUECK AND
AUFNR = T_ZSCPRT100-AUFNR AND
STOKZ = SPACE AND
STZHL = 0.
I had also cheked by createing an index for AUFNR in the table AFRU...it does not help.
Is there anyway that we can declare Key field while declaring the Internal table....?
ANy suggestions to fix the performance issue is apprecaited!
Regards,
KittuHi,
Thank you for your quick response!
Rui dantas, i have lill confusion...this is my code below :
data : t_zscprt type standard table of ty_zscprt,
wa_zscprt type ty_zscprt.
types : BEGIN OF ty_zscprt100,
aufnr type zscprt100-aufnr,
posnr type zscprt100-posnr,
ezclose type zscprt100-ezclose,
serialnr type zscprt100-serialnr,
lgort type zscprt100-lgort,
END OF ty_zscprt100.
data : t_zscprt100 type standard table of ty_zscprt100,
wa_zscprt100 type ty_zscprt100.
Types: begin of ty_afru,
rueck type CO_RUECK,
rmzhl type CO_RMZHL,
iedd type RU_IEDD,
aufnr type AUFNR,
stokz type CO_STOKZ,
stzhl type CO_STZHL,
end of ty_afru.
data : t_afru type STANDARD TABLE OF ty_afru,
WA_AFRU TYPE TY_AFRU.
SELECT AUFNR
POSNR
EZCLOSE
SERIALNR
LGORT
FROM ZSCPRT100 INTO TABLE T_ZSCPRT100
FOR ALL ENTRIES IN T_ZSCPRT
WHERE AUFNR = T_ZSCPRT-PRTNUM
AND SERIALNR IN S_SERIAL
AND LGORT IN S_LGORT.
IF sy-subrc <> 0.
MESSAGE ID 'Z2' TYPE 'I' NUMBER '41'. "BDCG87
stop."BDCG87
ENDIF.
ENDIF.
SELECT RUECK
RMZHL
IEDD
AUFNR
STOKZ
STZHL
FROM AFRU INTO TABLE T_AFRU
FOR ALL ENTRIES IN T_ZSCPRT100
WHERE RUECK IN S_RUECK AND
AUFNR = T_ZSCPRT100-AUFNR AND
STOKZ = SPACE AND
STZHL = 0.
Using AUFNR, get AUFPL from AFKO
Using AUFPL, get RUECK from AFVC
Using RUEKC, read AFRU
In other words, one select joining AFKO <-> AFVC <-> AFRU should get what you want.
This is my select query, would you want me to write another select query to meet this criteria..
From AUFNR> I will get AUFPL from AFKO> BAsed on AUFPL I will get RUECK, based on RUEKC i need to read AFRU..but i need to select few field from AFRu based on AUFNR....
ANy suggestions wil be appreciated!
Regards
Kittu -
How to verify the Source systems connectivity with BWQ System.
Hi All,
I have diff source systems. And my requirement is to check the source systems connectivity with BWQ (BW Quality sys). please any body tell me the steps how to check the source system connectivity ?
Thanks & Regards,
ManjuHi Manjula,
If you encounter problems when establishing a connection to your target server, check the following:
A message box appears while performing one of the following actions:
Setting connection by choosing Apply to local session.
Testing connection settings by choosing Test settings.
Creating SAP TSQL objects
If errors occurred, they are displayed in the respective message box.
Check developer trace files in ST11.
Test connection:
For RFC related errors, check the RFC connection via SM59
For database multi-connect errors, check if you can connect to the target SQL Server with the SQL Server Query Analyzer. Also check if the DBCON entries are correct.
Regards,
RK
Maybe you are looking for
-
IPhone 3G- I'm so frustrated- please help!
I was super excited about this new phone and purchased my new 3G on the 20th and have been on a roller coaster of emotions ever since. On one hand I'm impressed with cool apps such as "Shazam" that allows me to capture which song just played on the r
-
Please help w/ major ipod problem
black screen with a white apple is all i get. repeatedly turns on and off till battery dies. will not reset or be recoginized by computer
-
Quicktime Stopped Working...
every time i open up quicktime it instantly says "Quicktime has stopped working. Windows is searching for a solution to this problem." when it never finds a solution. I need quicktime for iTunes, and i want to buy a new ipod but can't unless i know i
-
Material document per Outbound Delivery Line
Dear Experts, We have an Outbound Delivery having 5 line items. I have a couple of questions. 1). How may material doc numbers will be generated? 2). Can I have 5 different material docs if I post GI 5 times (Per line). Is this scenario possible? ple
-
Some C1242 Radios are disabled after WLC 5508 upgrade to 7.3.101.0
One week ago I use a WLC 5508 to place and replace another WLC 5508 with version 6.0.199.4, when I conect the new WLC all AP´s works OK only 10 dont work and not are recognizes from the WLC with version 7.3.101.0. The fail is the radios sta