How to combine two queries in one EXCEL
hi i got one requirement
i got one excel sheet from user which contains two report s(hoe we know whether it is worknook or not) of 2011 data and now user wants 2012 data .now i icluded jan 2012 to dec 2012 in two reports and sent to user.But user is asking these two reports want to see in one sheet.
so how can i proceed: if i go for work book how can i include these two reports in workbook and here my doubt is if i create a workbook based on these two querie which name i have to give user.Please help me out on the same.
Regards,
Madhu.
Hi Madhu
Run one query. Click on a empty space in the excel
From the BEx Design Toolbar -
>Insert Analysis Grid -
> Right click on the Design Item
Edit the DataProvider.....You can ran same or different query with selection.
Save the result
Check this link for detail....I am also searching for something with screenshot
Regards
Anindya
Edited by: Anindya Bose on Feb 14, 2012 3:04 AM
Similar Messages
-
How to Combine two queries into One
Hi Gurus,
SQL> select * from v$version;
BANNER
Oracle Database 10g Release 10.2.0.4.0 - 64bit Production
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL>
I have following two queries. How I can convert these two queries into one with the same result ?
Q1
SELECT id,vdate,vendorname,venddate,vid
FROM VENDOR
WHERE processid=32
AND venddate is null
AND vid in(select vid from view_vid where type='PDX')
AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=55)
AND (id,vdate) in (select id,vidate from market_data where marketed_date is null)
AND id not in (select id from location)
Q2
SELECT id,vdate,vendorname,venddate,vid
FROM VENDOR
WHERE processid=20
AND venddate is null
AND vid in(select vid from view_vid where type='PBX')
AND (id,vdate) not in (select id,vdate from vkfl_is where task_id=40)
AND (id,vdate) in (select id,vidate from market_data where region_date is null)
AND id not in (select id from location)
I can UNION these two queries, but, is there any way I can write a single query with which gives me same result as above two queries?
Any help would be highly appreciated
Thanks in advanceHi,
You can do something like this, which will be more efficient than a UNION:
SELECT id, vdate, vendorname, venddate, vid
FROM vendor
WHERE ( ( -- Conditions that apply only to q1
processid = 32
AND vid IN (SELECT vid FROM view_vid WHERE type = 'PDX')
AND (id,vdate) NOT IN ( SELECT id, vdate
FROM vkfl_is
WHERE task_id = 55
AND (id,vdate) IN ( SELECT id, vidate
FROM market_data
WHERE marketed_date IS NULL
OR ( -- Conditions that apply only to q2
processid = 20
AND vid IN (SELECT vid FROM view_vid WHERE type = 'PBX')
AND (id,vdate) NOT IN ( SELECT id, vdate
FROM vkfl_is
WHERE task_id = 40
AND (id,vdate) IN ( SELECT id, vidate
FROM market_data
WHERE region_date IS NULL
-- The remaining conditions apply to both q1 and q2
AND venddate IS NULL
AND id NOT IN (SELECT id FROM location)
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
Explain, using specific examples, how you get those results from that data.
See the forum FAQ: https://forums.oracle.com/message/9362002 -
Combining two queries in one..
Hi,
Can someone tell me how to combine follwoing two queries in one so that it will increase performance..
SELECT single PLNNR from AFKO
into T1
WHERE AUFNR = '007200000100'.
SELECT single STATU from PLKO
into T2
WHERE PLNNR = T1.using subqueries it is possible
select single statu from plko into t2 where plnnr in (select single plnnr from afko where aufnr eq '007200000100').
read about subqueries at this link...
http://help.sap.com/saphelp_erp2004/helpdata/en/dc/dc7614099b11d295320000e8353423/frameset.htm
regards,
PJ -
How to fire two queries in one bean
When I am trying to fire two queries using statement and result set
it is showing error "result set is closed".
How to fire two queries?Just do it. The ResultSet should be the result of the query. So you're working on a wrong reference or something.
-
How to combine two photos in one without white border?
I am trying to combine two different photos next to each other (each 10 cm * 7.5 cm) in one of 10 cm * 15 cm and save it as a jpg file. Unfortunately when I do this in the print module (custom package) I get a file with a white border. I have set up page settings to 10*15 cm without border. How can I get a combined file without a border?
Titas,
This involves row level comparison of the report column data values we can achieve this in BI Publisher but at answers level there is no option.
Thanks,
Saichand -
I have two queries and I would like to output the results as
one and sort by Name ASC
Any help would be great thanksEither use union in your SQL query or use Coldfusion to
combine exisitng queries and create a new query resultset.
Something like this:
<CFQUERY NAME="getDetailsQuery1"
DATASOURCE="#DSNNAME#">
SELECT * FROM getDetailsA
</CFQUERY>
<CFQUERY NAME="getDetailsQuery2"
DATASOURCE="#DSNNAME#">
SELECT * FROM getDetailsB
</CFQUERY>
<CFQUERY NAME="getDetails" DBTYPE="query">
SELECT * FROM getDetailsQuery1
UNION
SELECT * FROM getDetailsQuery2
ORDER BY Name ASC
</CFQUERY>
Hope this helps!
Cheers / Manu. -
How to combine two albums in one ?
Hi, I bough a new mac and with it came the fastideous task of re-adding all the albums to iTunes once again.
Everything was going fine until I added a album which has 2 CDs 14 tracks in one CD and 5 more in a Bonus CD what happen when I added the CDs to the library was that iTunes made two different albums.
I tried changing the info, the name of album, the name of the artist even the release year everything was equal, yet iTunes didn't combine the two albums in one as it should.
After I selected both albums went to get info, options and in the Part of a compilation I selected Yes, which made the smaller album to disapear, the songs are in the library, but the album disappeared from the album library.
Any suggestion ?Generally setting a common Album title and Album Artist will fix things.
For deeper problems see Grouping tracks into albums.
Closing and reopening iTunes will usually restore any album that "disappears" after an edit.
tt2 -
How to combine two albums into one
I imported into iTunes two Shostakovich compositions so that I could burn a CD-R that contained these two works. The CD burning went fine, but iTunes insists on separating the two compositions into two albums in the display of all albums. I have made sure that the album titles and the artists displayed under the album icons are identical, but still the two will not meld into one. Will someone help me with this? I am using iTunes 9.2.1(4).
On the "Get Information" windows (reached with right clicks) of the two separated albums, one album was marked as "no" on the "part of a compilation" option and the other was marked "yes". I changed the "no" to a "yes" and they merged. I'm not sure if I got this from the site you gave me or if I just stumbled on to it. Either way, I thank you for your kind responses.
-
Combining two queries into one query if possible
Hi there. I would like, if possible, to somehow combine the queries 1) and 2) into a single query.
1) select distinct user_id from system_user_sessions;
This query returns all unique users from the indicated table.
2) select count(session_id) from system_user_sessions where user_id = "each user_id returned from 1)";
This query will return, for each distinct user_id, the number of sessions involving that user. In other words I would like to return the user_id of each user together with the number of session_ids involving that user.
any ideas? JoeI assume you are looking for something like this:
select count(session_id)
from system_user_sessions
where user_id in ( select distinct user_id
from system_user_sessions
);HTH
Ghulam -
How to combine two queries using Web application Designer
Hello experts...
This should be a simple request.
I have two existing queries that I simply want to display on the same template. What is the best way to do this?
To add more complexity to it, if there is a result value that I want to pull from each of them, how can this be done so that I can add the results of the two into one total?
Any help that you can provide is greatly appreciated. ThanksHi,
Displaying the existing queries on the same template is very simple... Drag and drop to web items... for ex we will drag and drop two analysis web item...
Create 2 data providers and assign it to the web items... each dataprovider is in turn assigned to two existing queries...
I am not sure about the result value to be pulled from each of them...
Regards,
Kishore -
How to combine two queries?
Can you help to combine these two categories so that I can have dynamic pivot table ?
Thank you,
IF OBJECT_ID('Temp') IS NOT NULL
DROP TABLE Temp
select 'Referrals Received' AS CategoryType,
'A' AS CategorySort,
cn.Cntry_Definition as Cntry,
COUNT(*) AS Cnt,
SUM(SUM(1)) OVER () AS Total
INTO Temp
from WRAPSIST0.dbo.tblindividual i
inner join WRAPSIST0.dbo.tblcase c on c.case_guid = i.case_guid
inner join WRAPSIST0.dbo.tblCountry CN on CN.Cntry_Code=c.Cntry_CodeLocation
inner join WRAPSIST0.dbo.tblfiscalyear fy on case_createdate between fy_startdate and fy_enddate
where fy_year = '2014' and casear_code <> 'du' and c.CaseP_Code<>'sv'
GROUP BY cn.Cntry_Definition
order by cntry asc
DECLARE @CountryList varchar(8000),@SQL varchar(max)
SELECT @CountryList= STUFF((SELECT ',[' + Cntry + ']' FROM Temp FOR XML PATH('')),1,1,'')
SET @SQL = 'SELECT CategoryType,' + @CountryList + ',Total FROM Temp t
PIVOT(SUM(Cnt) FOR Cntry IN (' + @CountryList + '))p'
EXEC(@SQL)
IF OBJECT_ID('Prescr') IS NOT NULL
DROP TABLE Prescr
select 'Prescreen Completed' AS CategoryType,
'B' AS CategorySort,
cn.Cntry_Definition as Cntry,
COUNT(*) AS Cnt,
SUM(SUM(1)) OVER () AS Total
INTO Prescr
FROM ReportStatistician.dbo.vwEventLog_LatestPSI_SCH t
inner join WRAPSIST0.dbo.tblIndividual i on i.Ind_GUID=t.Ind_GUID
inner join WRAPSIST0.dbo.tblCase C on C.Case_GUID=i.Case_GUID
inner join WRAPSIST0.dbo.tblNationality N on N.Nat_Code=i.Nat_Code
inner join WRAPSIST0.dbo.tblCountry CN on CN.Cntry_Code=c.Cntry_CodeLocation
inner join WRAPSIST0.dbo.tblfiscalyear fy on t.EventLog_EffectiveDate between fy_startdate and fy_enddate
where fy_year = '2014' and c.PreS_Code='com'
GROUP BY cn.Cntry_Definition
order by cntry asc
--DECLARE @CountryList varchar(8000),@SQL varchar(max)
SELECT @CountryList= STUFF((SELECT ',[' + Cntry + ']' FROM Prescr FOR XML PATH('')),1,1,'')
SET @SQL = 'SELECT CategoryType,' + @CountryList + ',Total FROM Prescr t
PIVOT(SUM(Cnt) FOR Cntry IN (' + @CountryList + '))p'
EXEC(@SQL)
CREATE TABLE #final
CategoryType varchar(50),
CategorySort char(1),
cntry char(20),
Total int
select CategoryType, cntry, Total
from #final
order by CategorySort
Erdal HuzmeliThe result of the query looks as following;
CategoryType
Kuwait
Lebanon
Turkey
United Arab Emirates
Yemen
Total
Referrals Received
1
2
3
4
5
CategoryType
Kuwait
Lebanon
Turkey
United Arab Emirates
Yemen
Total
Prescreen Comleted
6
7
8
9
10
I want the query to show the following result if it possible?
CategoryType
Kuwait
Lebanon
Turkey
United Arab Emirates
Yemen
Total
Referrals Received
1
2
3
4
5
Prescreen Completed
6
7
8
9
10
Thank you,
Erdal Huzmeli -
How to combine two dataModel in one JTable
rs = stat.executeQuery(query);
model = new ResultSetTableModel(rs); <--- a class to create AbstractTable Model
JTable table = new JTabel(model)
will show only the data inside the model
I want to append some new information
How to do??Use the DefaultTableModel and then the addRow(...) method to add additional rows.
-
How do I combine two regents into one in Logic Pro Arrange?
how do I combine two regents into one in Logic Pro Arrange?
Thanks for your input kcstudio. I would still be left with 2 regions although one after the other, on one track.
I am trying to save steps of the way I am combining the info of 2 seperate regions into one: bouncing the 2 tracks then re-importing that audio back into the project. It would save a lot of time if you could just drag one region on top of the other
W.W. -
HT4759 How do I combine two accounts into one
How can I combine two accounts into one account
If you are talking about iCloud accounts, you can't.
Or you could tell us what type of accounts these are? -
Run two report in one Excel sheet1 and sheet2
Hi all;
I want to have my one report in sheet1 and another one in sheet2 when I opened my excel sheet. How can I perform this two report in one excel sheet. I can copy the report and paste but then there would be no drill down or other functionality.
thank. you.Hi Krishma,
You can save this workbook to your PC and email it to your user. They need to open the workbook (with Bex running in Excel). When they click the refresh button they system will prompt them to log on (if they are already not logged in) and then the queries will be executed.
Hope this helps...
Maybe you are looking for
-
I just purchased iPhone 4s. Before setting it up want to ask this question, Right now I have iPhone 4 with iOS5 installed. When inistially setting up iOS5 on the iPhone4 I had to create a me.com address. This address is being used for iCloud. My
-
Assume a file contains these values, one per line, as below: 100 50 200 300 30 70 Write a code snippet that reads the values and uses a method named drawLine() to draw the line segments. Assume drawLine() accepts the four arguments (x1, y1, x2, y2) ,
-
Add Custom Fields in FB70?
Is it possible to add custom fields in FB70 to capture extra data? We enter FI-A/R invoices in FB70 and would like to capture data in the custom fields of sales order (VA02) additional data B screen for reporting purposes. (We do not use debit memo
-
Illustrator CS3 - type/font and right click/font quit working??!!
All of a sudden: if I type a word out and then go to "type/font".... none of the installed font selections will show.....also will not show if the text is selected and I "right-click" my mouse. I can change fonts if I use the interactive menu at the
-
Is it possible to get the license of photoshop and lightroom after 4 years of subscription?
Is it possible to get the license of photoshop and lightroom after 4 years of subscription?