How to transpose the query with the following result
Dear all,Can someone tell me a method to convert my query result
Details are provided in
http://obiee11ge.blogspot.com/2010/07/how-to-transpose-query-with-following.html
Concerning
Mustafa
Hello
Try this
Create a request combined with,
criterion no. 1: model, revenue (Actual), Cogs (Actual), Opex (Actual), PL (Actual)
in the dummy column fx enter the "Real" value
criterion 2: model, revenue (Yago), Cogs (YAgo), Opex (Yago), PL (Yago)
in the dummy column fx enter the value as "Yago".
criterion 3: model, revenue (Budget), Cogs (Budget), Opex (Budget), PL (Budget)
in the dummy column fx enter the value as 'Budget '.
Now go to the columns of result and set names coumn (revenue, COGS, Opex, PL) for the result set.
For the Dumny, remove column header.
In a sheet view, you will get the result.
Thank you
Vino
Tags: Business Intelligence
Similar Questions
-
How to convert the following code in as3?
As the title says... How to convert the following code to as3?... Thanks in advance.
import flash.display.BitmapData;
linkageId = "landscape";
myBitmapData = BitmapData.loadBitmap (linkageId);
MC = this.createEmptyMovieClip ("mc", 1);
mc.attachBitmap (myBitmapData, 1);onMouseMove = function() {}
myNewColor = "0 x" + myBitmapData.getPixel(_xmouse,_ymouse).toString (16);
newColor.setRGB (myNewColor);
selectedColor.colorValue.text = myNewColor;
}
selectedColor.swapDepths (_root.getNextHighestDepth ());
newColor = new Color (selectedColor.sample);:
var myBitmapData:landscape = new landscape (0,0);
var bmp:Bitmap = new Bitmap (myBitmapData);
addChild (bmp);stage.addEventListener (MouseEvent.MOUSE_MOVE, f);
function f(e:MouseEvent):void {}
var myNewColor:String = "0 x" + myBitmapData.getPixel(mouseX,mouseY).toString (16);
newColorTransform.color = uint (myNewColor);
selectedColor.sample.transform.colorTransform = newColorTransform;
selectedColor.colorValue.text = myNewColor;
}
addChild (selectedColor);
var newColorTransform:ColorTransform = selectedColor.sample.transform.colorTransform; -
How to explain the following code?
How to explain the following code?
1 set setOpenTradeIds = mapTrades.keySet (filter);
2 map mapResults = null agent, map.invokeAll ((Filter));
Is defined a class and setOPenTradeIds a new object?
Is card calss and mapResults a new object?
Thank you
Published by: frank.qian on June 7, 2009 10:48Hi Frank,.
Is mapTrades an object and a set of keys one of its methods?
mapTrade is a reference variable refers to an instance of a class that implements the keySet() method that returns a reference to an instance of a class that implements the interface of game
What is map.invokeAll? Where to get the information about it?
map is a reference variable refers to an instance of a class that implements the invokeAll() method that returns a reference to an instance of a class that implements the map interface In case of card to make reference to an instance of a class that implements the InvocableMap interface, you can find consistency documentation 3.4.2 method to InvocableMap.
Kind regards
Harv
-
* O.T. AND NON-RESPONSE ERROR
Hi, my laptop (Dell vostro) has been very slow lately, when I run "sfc/scannow" he gave the following results; "protection of resources windows found corrupt files but was unable to solve some of them"
How ca I fix it please help
Select Start, all programs, accessories, right-click right-click command prompt and click Run as administrator in the menu dropdown. Type or copy / paste: findstr/c: "[SR]" %windir%\Logs\CBS\CBS.log > '% userprofile%\Desktop\sfcdetails.txt' and press the ENTER key. You will find a sfcdetails.txt file on your desktop.
"Please note there are three spaces in the command: findstr - c/c/c, between [SR]" and%windir% between CBS.log and > ' % userprofile .
Please download a copy of your file sfcdetails.txt on your OneDrive as a shared file and post a link here. Enter sfcdetails.txt in the search box above the Start button and press the ENTER key to locate the file created.
Note The Sfcdetails.txt file contains details of every time that the System File Checker tool has been run on the computer. The file contains information about the files that are not repaired by the System File Checker tool. Check the date and time entries to determine the problem files that were found last time that you ran the System File Checker tool.
For assistance OneDrive see paragraph 9.3:
-
How to transpose the rows in multiple columns by using PivotTable
I have 1 line containing 12 columns with the value "JAN", "FEB", "MAR", "J-1","F-1","M-1","J-2","F-2","M-2","J-3","F-3","M-3"
I want to display like
JAN J - 1 F - 1 M - 1
FEB J - 2 F - 2 M - 2
MAR F - 3 J - 3 M - 3
How to achieve the foregoing?Today, you have only 3 months JAN, Feb, Mar. Is it always the same number of columns. What happens if several months ago we added this line?
Your data is really coming from relational source or some sort of text file?
There is a better way to do this in narrative using HTML mode, if your condition is just to show them in several lines and do some math.
Go to Narrative display;
In the prefix, use
In the text box 'Story' add something like that
@1 @4 @7
@2 @5 @8
@3 @6 @9 As a suffix, use
You can also add simple calculations like sum etc at the bottom of these lines as the overall totals.
Kris
-
How to write the following SQL
I have a table with the following columns seq_no, customer_no, sales_person, card_type, NTB_Cust, paid_flag. He basically tells what a person sale that sold the customer what card, and if the customer is a New_To_Bank. Seq_no field is a sequence running. I need fill out the paid_flag as 1 or 0 according to certain rules.
The first point to consider is that the card_type should be "PREFERRED" and NTB_Cust = "NTB".
Then, if the sales_person has sold two cards that follow with the above criteria, in the same customer_no, then only the first will be marked with paid_flag = 1. If he sold 3 consecutive to the same customer cards, then the 1st and the 3rd will be marked as paid_flag = 1. If the sales_person has sold 4 cards to the same customer and then the 1st and the 3rd will be marked as paid_flag = 1. And so on.
See below the expected value of paid_flag
seq_no card_type NTB_Cust paid_flag customer_no sales_person
XXX 999 FAVORITE NTB 1 1
2 999 FAVORITE NTB XXX 0
XXX 3 999 FAVORITE NTB 1
4 999 PRESTIGE NTB XXX 0
XXX 5 888 FAVORITE NTB 1
XXX 6 888 FAVORITE OLD 0
7 FAVORITE NTB 888 XXX 1Hello
Try
WITH T1 AS ( SELECT 1 seq_no, 'XXX' sales_person, 999 customer_no, 'PREFERED' card_type, 'NTB' NTB_Cust, 1 paid_flag FROM DUAL UNION ALL SELECT 2, 'XXX', 999, 'PREFERED', 'NTB', 0 FROM DUAL UNION ALL SELECT 3, 'XXX', 999, 'PREFERED', 'NTB', 1 FROM DUAL UNION ALL SELECT 4, 'XXX', 999, 'PRESTIGE', 'NTB', 0 FROM DUAL UNION ALL SELECT 5, 'XXX', 888, 'PREFERED', 'NTB', 1 FROM DUAL UNION ALL SELECT 6, 'XXX', 888, 'PREFERED', 'OLD', 0 FROM DUAL UNION ALL SELECT 7, 'XXX', 888, 'PREFERED', 'NTB', 1 FROM DUAL ) SELECT T1.*, CASE WHEN MOD(ROW_NUMBER() OVER (PARTITION BY customer_no, card_type ORDER BY SEQ_NO),2)=1 AND CARD_TYPE = 'PREFERED' AND NTB_Cust='NTB' THEN 1 ELSE 0 END PAID_FLG_FROM_SQL FROM T1 ORDER BY SEQ_NO;
* 009 *.
-
How to configure the following parameters of syslog by PowerCLI
I'm currently building ESXi 5.0 and a lot of PowerCLI allows you to configure the host.
I used to put in place a reote syslog server
Game-VMHostSysLogServer -SysLogServer $SySLog -$vmhost '$hostname'
$esxcli= Get EsxCli
$esxcli. System .syslog. Reload()
to apply a new remote syslog server, but I also need to set the following.
but I also need to configure the following items.
view the system log in the equal of Dir for the name of the server. This seems to be a "True/false" option
syslog.global.logDirUnique
make a local copy of the syslogs also on a vmfs datastore.
Syslog.global.logDir
can the $esxcli. System . build be used to apply these configurations
As far as I know, you can use the Set-VMHostAdvancedConfiguration cmdlet to change these settings.
-
How to get the desired result when subsequent month is not available
WITH T1 AS (SELECT 'A' COL1, 'B' COL2, 'C' COL3, '01-Jan-2015' DT, 10 QTY FROM DUAL UNION SELECT 'A' COL1, 'B' COL2, 'C' COL3, '01-feb-2015' DT, 20 QTY FROM DUAL UNION SELECT 'A' COL1, 'B' COL2, 'C' COL3, '01-mar-2015' DT, 30 QTY FROM DUAL UNION SELECT 'A' COL1, 'B' COL2, 'C' COL3, '01-may-2015' DT, 40 QTY FROM DUAL UNION SELECT 'A1' COL1, 'B1' COL2, 'C1' COL3, '01-mar-2015' DT, 40 QTY FROM DUAL UNION SELECT 'A1' COL1, 'B1' COL2, 'C1' COL3, '01-may-2015' DT, 40 QTY FROM DUAL) SELECT * FROM t1
Current output:
COL1 COL2 COL3 DT QTY. A B C January 1, 2015 10 A B C February 1, 2015 20 A B C 01-mar-2015 30 A B C 01-may-2015 40 A1 B1 C1 01-mar-2015 40 A1 B1 C1 01-may-2015 40 Expected results
COL1 COL2 COL3 DT QTY. DT REQ_VAL A B C 01/01/2015 10 01/01/2015 20 A B C 01/02/2015 20 01/02/2015 30 A B C 01/03/2015 30 01/03/2015 0 A B C 01/05/2015 40 01/05/2015 0 A1 B1 C1 01/03/2015 40 01/03/2015 0 A1 B1 C1 01/05/2015 40 01/05/2015 0 Logic:
If we COL1, COL2, COL3 combination for A, B, C, we have the quantity for 1 January, 1 February, 1 March, 1 may, and we don't have quantity for April 1 and June 1. I need following QUANTITY value as another column. If I use the lead, I'll get the value from May 1st to March 1st, but I want to value 0 because it is after March either.
What I've tried so far:
SELECT * FROM (WITH T1 AS (SELECT 'A' COL1, 'B' COL2, 'C' COL3, '01-Jan-2015' DT, 10 QTY FROM DUAL UNION SELECT 'A' COL1, 'B' COL2, 'C' COL3, '01-feb-2015' DT, 20 QTY FROM DUAL UNION SELECT 'A' COL1, 'B' COL2, 'C' COL3, '01-mar-2015' DT, 30 QTY FROM DUAL UNION SELECT 'A' COL1, 'B' COL2, 'C' COL3, '01-may-2015' DT, 40 QTY FROM DUAL) SELECT COL1, COL2, COL3, TO_DATE (T1.DT) DT, NVL (QTY, 0) QTY, MONTHS.DT ALL_DATES, LEAD (NVL (QTY, 0), 1, 0) OVER (ORDER BY MONTHS.DT) REQ_VAL FROM T1, ( SELECT ADD_MONTHS (TO_DATE ('01-jun-2015'), LEVEL - 6) DT FROM DUAL CONNECT BY LEVEL <= 12) MONTHS WHERE MONTHS.DT = T1.DT(+)) WHERE DT ISNOTNULL;
My query works for a set of COL1, COL2, COL3, am looking how we can achieve multiple COL1, COL2, COL3 (or) otherwise better query writing.
Thanks for your suggestions in advance.
Thank you
Now, to understand your condition: your additional column must indicate the amount of the next month, or zero if it is not a record for the month. How about this?
WITH T1
AS (SELECT 'A' COL1,)
'B' COL2,
COL3 'C ',.
To_date('01-Jan-2015','dd-mon-yyyy') DT,
QTY 10
OF THE DOUBLE
UNION
SELECT 'A' COL1,
'B' COL2,
COL3 'C ',.
To_date('01-Feb-2015','dd-mon-yyyy') DT,
QTY. 20
OF THE DOUBLE
UNION
SELECT 'A' COL1,
'B' COL2,
COL3 'C ',.
To_date('01-Mar-2015','dd-mon-yyyy') DT,
QTY 30
OF THE DOUBLE
UNION
SELECT 'A' COL1,
'B' COL2,
COL3 'C ',.
To_date('01-May-2015','dd-mon-yyyy') DT,
QUANTITY 40
OF THE DOUBLE
UNION
SELECT 'A1' COL1,
COL2 "B1."
COL3 "C1"
To_date('01-Mar-2015','dd-mon-yyyy') DT,
QUANTITY 40
OF THE DOUBLE
UNION
SELECT 'A1' COL1,
COL2 "B1."
COL3 "C1"
To_date('01-May-2015','dd-mon-yyyy') DT,
QUANTITY 40
THE DOUBLE)
X.Col1, x.col2, x.col3, x.dt, x.qty, NVL(y.qty,0) SELECT req_val
THE t1 x
LEFT OUTER JOIN t1 y
ON y.col1 = x.col1
AND y.col2 = x.col2
AND y.col3 = x.col3
AND y.dt = add_months(x.dt,1)
ORDER BY 1,2,3,4
My query works for a DFU, am looking how we can achieve multiple UTD
What is a DFU?
-
How to clear the search results in an af:table?
Hi all
I use Jdeveloper 11 g with ADFBC.
I have a query with a table of readonly page to display the result of the query, and there is a "Reset" button on the page (NOT reset in motion control) to clear the search results in the table.
I try the following code to clear the contents of the search results, BUT it does not work. The data in the table is always run after the code below here.
Can someone help me? How to clear the contents in an af:table supporting the Java bean code?DCIteratorBinding binding = ADFUtils.findIterator("UserVO1Iterator"); if (binding!=null) { binding.clear(); }
Kind regards
Samson FuYou can also try to call the method executeEmptyRowSet() on the view of the iterator object instance
Sample:
binding.getViewObject().executeEmptyRowSet()
Jean Lou
-
How to divide the DB results in addition to a column
I have some code (see below) which separates the results from a query db in two columns. However, the results print left to right, row by row. Which displays almost correctly, however, I need to display the results of the first half in a column, and the second half of the results in a second column. I can't understand how to change the code to display the first column with 1/2 of the results.
< CFSET maxcol = 2 >
< TABLE BORDER = "0" cellpadding = "3" cellspacing = "0" >
< CFSET outcol = 0 >
< CFOUTPUT QUERY = "Candidate" >
< CFIF outcol EQ 0 > < TR > < / CFIF >
< TD width = "30%" > < span class = "BodyContent" > #Candidate # </span > < table >
< CFSET outcol = outcol + 1 >
< CFIF outcol EQ maxcol >
< /TR >
< CFSET outcol = 0 >
< / CFIF >
< / CFOUTPUT >
< CFIF outcol NEQ 0 > < /TR > < / CFIF >This could be a little Kludgy, but hey, it works...
First of all, a quick count of the db
SELECT COUNT (*) AS CandidateCount
CandidatesThen divide the total by 2 and 1 for good luck.
Then write on the table.
#Candidate #.
-
How to change the "Failed" result State after the test of "success."
We do a picture of a LCD screen and watch if his work of all. Sometimes, the LCD is good work but the step failed. Where automatic LCD test fails show us the image of the camera to the user and it can decide if the LCD for success or failure. So when the user decides that the screen is good job we have to crush the status of the automatic test demonstrating lcd screen test passed in the report and the database. I tried with
RunState.SequenceFile.Data.Seq ["Check_LCD_V3-0"]. Hand [' 154 Execute - all horizontal Segments on "]. Result.Status = "Passed",
RunState.SequenceFile.Data.Seq ["Check_LCD_V3-0"]. Hand [' 154 Execute - all horizontal Segments on "]. Result.PassFail = "True",But in the basis of the status of this step is always 'impossible '.
What I've done wrong?
Thank you
Alteschwed wrote:
We do a picture of a LCD screen and watch if his work of all. Sometimes, the LCD is good work but the step failed. Where automatic LCD test fails show us the image of the camera to the user and it can decide if the LCD for success or failure. So when the user decides that the screen is good job we have to crush the status of the automatic test demonstrating lcd screen test passed in the report and the database. I tried with
RunState.SequenceFile.Data.Seq ["Check_LCD_V3-0"]. Hand [' 154 Execute - all horizontal Segments on "]. Result.Status = "Passed",
RunState.SequenceFile.Data.Seq ["Check_LCD_V3-0"]. Hand [' 154 Execute - all horizontal Segments on "]. Result.PassFail = "True",But in the basis of the status of this step is always 'impossible '.
What I've done wrong?
Thank you
I recommend the following:
(1) that the display automatically to test an Action step rather than a step for success/failure and set to square one local variable to see if the LCD self-test failed (for example Locals.AutomatedLCDFailed).
(2) create a new test pass/fail (using the no adapter) that takes both the variable local and entry of the user account to determine it is the condition for success/failure (for example to set the data source of the step to an expression like:!) () Locals.AutomatedLCDTestFailed & Locals.UserLCDTestFailed)
As an alternative to do 1) a step of the Action you can leave a step for success/failure and clear step on it to "step failure causes failure of sequence. You can then use the status of this step instead of Locals.AutomatedLCDTestFailed. The only difference is that the automated test will always be displayed as failed in your report, although the sequence can still be passed. It is somewhat a matter of preference.
Hope this helps,
-Doug
-
How to sort the search results on several critiria
We use 10gr 3 of the Complutense University of MADRID and on our search results page would like to sort the results returned based on several criteria. For example, first sort us on a field with possible values 1-9, then sort by modified date.
Currently, we have:
<!-$ SortField = "xCustom"->
<!-$ SortOrder = "DESC"->
<!-$executeService ("SS_GET_SEARCH_RESULTS")->
But it seems that if I place another set of these as:
<!-$ SortField = "xCustom"->
<!-$ SortOrder = "DESC"->
<!-$ SortField = "dInDate"->
<!-$ SortOrder = "DESC"->
<!-$executeService ("SS_GET_SEARCH_RESULTS")->
The sort will be performed just on the second set.
I found sortspec, but where example it returns results when you use the following is not:
<!-$ SortSpec = "dInDate DESC DESC xCustom"->
<!-$executeService ("SS_GET_SEARCH_RESULTS")->
Does anyone have experience with this?
I thank in advance.I think you have the syntax for this evil. It is rather SQL than anything
for example
OR
Have you watched the MultiSort component?
http://www.Oracle.com/technetwork/middleware/content-management/Multisort-10G-134216.zip
Hope you're going to get
Tim
-
How to get the overall result sequence into LabView?
Hello
Could someone can help with this little problem?
We have a batch (.bat) that launches a list given TestStand sequences, which works as expected.
However, we monitor the results of each sequence and display it to the operator.
Our idea is to get the result of the sequence in a VI, executed at the end of the sequence and add it to a queue, which will be extracted and displayed on a monitor of VI, executed separately.
The only problem we have left must be able to recover the overall result of the sequence. Any idea or suggestion?
Thank you
Raphael
Thanks for all your replies. We finally finished queues sequencefailed node sequence context property value.
I also discovered the TestStand database logging and began to use it in parallel.
Thanks again
-
I have an accmaster say table where each record has detailts on an acct as actno, curr_bal, branch, acct_type I want something as below a
branch_no - Sum (curr_bal) where acct_type like 1% ' as sb - sum (curr_bal) where acct_type like 2%'s fd of the Group table by branch in a single line as shown below
00001 550000 65000000
00002 75909000 2568229867
Please tell how to do the above operation.Hello
This is called a Pivot , and here's a way to do it:
SELECT branch_no , SUM (CASE WHEN acct_type LIKE '1%' THEN curr_bal END) AS total_1 , SUM (CASE WHEN acct_type LIKE '2%' THEN curr_bal END) AS total_2 FROM accmaster GROUP BY branch_no ;
This will work in any version of Oracle, from 8.1, but starting in Oracle 11.1, you can also use the SELECT... Function PIVOT.
I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
Explain, using specific examples, how you get these results from these data.
Always tell what version of Oracle you are using.Furthermore, your table is called
accmaster (where, I guess, ACC means 'account') and it contains called columns
ACTNO ( Act means 'account') and
acct_type ( acct means 'account')
Do you really need 3 different ways to shorten "account"? How do you recall when you used a way and when you have used another or when you used an underscore after the abbreviation character, and when you do not have? Even if you never get confused by these things, someone trying to help you, and one that should keep your code in the future, will probably. Do not use consistent, such as namespace
acct_master
Acct_No and
acct_type
? -
How to export the search results to Excel
Hi all
Our client needs features to export the search results to Excel (metadata)
Feature of IE (right click-> export to excel) does not work properly - delimiter converts empty column in the excellent columns.
Having someone met solution for this feature.
Thank you
LeonHi Leon,
For this feature, you can enable RM on the server of the University Complutense of MADRID in stand-alone mode that gives search results export to excel function.
Not only that you can export the contents of a variety of formats such as PDF, XLS, and 2-3 more.
Thank you
Srinath
Maybe you are looking for
-
Since the change of Tiscali to TalkTalk if I click on links in the emails read on webmail, I get the following error message and then I disconnected from TalkTalk webmail. HTTP status 404 - /cp/templates/applications/mail/html/null.jsp type status re
-
Updating BIOS for Win7 on Pavilion DV6000
Hello I have an older HP Pavilion DV6000 with 4 GB of RAM (2 GB RAM upgrade). However, only 2.69 GB can be used. It has been suggested that I have upgraded the BIOS and turn "remapping memory." The OS is Win7 Home Premium 32 bit OS. l has a p
-
255 HP: HP 255 enter password administrator or power on password
My phone gives me a black screen with a blue box and after that I entered a password for 3 times... It gives me: 90850119 system off. Please help its urgent.
-
Solid color BG for digital indicator
I'm trying to programmatically set the BG color for a digital indicator providing a color constant to the relevant property in the attachment node. However, I get only a stroke instead of the solid color background color. Cannot get on this issue.
-
"WindowsUpdate_00000646" "WindowsUpdate_dt000" does not install
I tried to install the update to windows and received this message: "WindowsUpdate_00000646" "WindowsUpdate_dt000"