Decode the values without ETL (Group Dimension values)
Hello guys, I have a question that is partly triggered by me not wanting to change the default ETLs.I have values in a dimension to come as table:
Area A
Region B
Region C
Region D
Region E
However, I'm hoping to re - org the hierarchy as below:
A new region
D new region
Essentially, there is a new org structure where we Group (consolidation) old parts in new and rename values.
I know it can be done in ETL but y at - it everywhere else where this is possible? Perhaps in the business layer? Is there a place in the business layer where we can decode the values and combine them?
Regards and thanks in advance for your help,.
Hello
You can do to the RPD layer with an instruction box on a column of logic. However I really wouldn't say that because it means that if the group never changes you need to release a new RPD to get change.
Why not build a task custom ETL that you can set to run after the vanilla who takes just these values, consolidates necessary (perhaps using a lookup table to find the old-> new maps) and then load it the new value in a column of extension on the dimension or the extension of related dimension, i.e. W_ORG_DX. Then, you can simply display this column in the presentation layer for users. Unless the table in question has millions of people off the coast of columns, just let him do this mapping for each row in the table for each ETL.
I think it would be a very simple task and would mean that you can change the mappings easily through the table if necessary. This also means that you don't need to touch the vanilla ETL mappings and are not changing the values in the columns of vanilla, as you mentioned that you didn't want to do.
Kind regards
Matt
Tags: Business Intelligence
Similar Questions
-
amount of data to decode the values retuening
How to calculate the sum of multiple values back to decode, the following conditions I: =.
sum (decode (v.value, 1, 1, 0)) s of the sum (decode (v.value, 2, 1, 0)) s1,
sum (decode (v.value, 4, 1, 0)) s3
now I want the sum of s, s1, s3..., but applying the sum at the level of the query does not... sum (s, s1, s3) does not work
Help, please
Published by: user12403816 on June 16, 2012 06:46The easiest way would be to wrap another query around that you have doing the decoding, something like:
select s, s1, s3, s + s1 + s2 total from (select sum(decode(v.value, 1 , 1 , 0 )) s, sum(decode(v.value, 2 , 1 , 0 )) s1, sum(decode(v.value, 4 , 1 , 0 )) s3 from ... where ...)
You could also add decodes and the sum which, something like:
select sum(decode(v.value, 1 , 1 , 0 )) s, sum(decode(v.value, 2 , 1 , 0 )) s1, sum(decode(v.value, 4 , 1 , 0 )) s3, sum(decode(v.value, 1 , 1 , 0 ) + decode(v.value, 2 , 1 , 0 ) + decode(v.value, 4 , 1 , 0 )) from ... where ...
John
-
Decode a value to a list of values
Hello
I am writing a parameterized cursor and I need decode the value of the parameter to a value list, but I am not able to find and elegant solution.
The line I currently have in the WHERE clause are:
AND (bes_ps_s_id = DECODE (UPPER (p_act_or_res), 'ACTIVE', 5444,
'RESOLVED', 5446)
OR
bes_ps_s_id = DECODE (UPPER (p_act_or_res), 'ACTIVE', 5445,
'RESOLVED', 5447)
)
I was hoping it would work
AND bes_ps_s_id IN DECODE (UPPER (p_act_or_res), 'ACTIVE', 5444 (5445)
'RESOLVED', (5446, 5447));
Can anyone offer a solution?
TaHello (and welcome!), simply:
AND ((UPPER(p_act_or_res) = 'ACTIVE' AND bes_ps_s_id IN (5444, 5445)) OR (UPPER(p_act_or_res) = 'RESOLVED' AND bes_ps_s_id IN (5446, 5447)))
No need to DECODE or business.
-
Database startup without repeating group of newspapers online HELP
Hello
I need help
I lost a full group online Redo Log (1A and 1B), I have only two of the three who had (2 a, 2 b - 3A, 3B), how do I do the database without this group.
Thank you for your cooperationMissed or corrupted file?
Corrupted: Add the parameter(ALLOW_RESETLOGS_CORRUPTION = TRUE) in PFile, start the DB using Pfile.
-
The value of a field to the bottom of the screen without setStatus()
Hello
I want to set a field to always be at the bottom of the screen without using setStatus() as it is opaque. Most of the discussions I looked at have a complex layout on top to a field at the bottom. I have a very flexible presentation, now that I have just my fields added to the Senior Manager. Is there a good way to push a field to the bottom of the screen? Or is it only possible by substituting the functions of some manager?
Ben
It's not trivial.
You must create a Manager and tell it to use all the way up and not be vertically scrollable. So the dimensions that are placed in its sublayout will give you the height available to you.
Now, you must add two managers to this Manager. The first is that you'll add all you fields too - it will be a standard value, so that it scrolls. The second will be the stuff you want at the bottom of the screen.
In sublayout you will be setting page, the second field first, get its height and then set its position is at the bottom. This will also give you the area that is available for your manager to scroll. You will be then layout manager to say the things that he is restrcted to the height that you left. As he scrolls will not worry.
Finally, in sublayout, you will find setExtent making sure you use all the height that you were given.
For more information:
http://supportforums.BlackBerry.com/T5/Java-development/how-to-extend-Manager/Ta-p/446749
-
I have a 10 GB dell powerconnect 8024f the switch and the firmware is OLD, but the port config shows maximum frame size = 9000 to all cable ports2 guests ESXi 5.5 wired, build 1331820, put each host computer network is managed by a single port dual qlogic 8150 ANC
When I connect to my windows VM to check my new 10 GB connectivity (it is configured for jumbo mtu = 9000 frames) and ping-l 8190 against ESXi vmkernel interface that was MTU of 1500, I get an answer without any packet loss... How can it be if the port is configured for only 1500 MTU? I thought that the two vmkernel port group and vswitch properties must have 9000 mtu defined, it appears that the vswitch properties override the port group properties.
But I know I must be missing something, a few important concepts, somewhere, because when I connect to ESXi via ssh I can ping devices with values greater than 8190 and not just windows virtual machines that reside on the same host where the ping uses the internal bus, but I am referring to the connections of the host of other ESXi on the switch management.
In summary - how the VMkernel does ping and response to pings of bigger sizes greater than the value of the switch upstream? and why do ping with large packets get answers when the vmkernel port group is always set at 1500, is this a bug or is this feature obsolete? I remember specifically in ESXi5 that I had to configure the vmkernel port group and the vswitch for this property to work.
Unless you specify "Don ' t fragment" (-f for Windows) you will be able to use any size package successfully.
For ESXi, take a look at Troubleshooting ESXi Jumbo Frames.
André
-
How to use the clause type without hard-coding the values inside?
Query
Select acct_no,
gl_code,
CASE
WHEN entry_type_label ("earned INCOME") THEN
"Recipes".
ON THE OTHER
"Deferred income of credit."
END as entry_type_label,
CASE
WHEN entry_type_label IN ("opening balance") THEN
"Opening balance".
WHEN entry_type_label ("deferred revenue CREDIT") THEN
"The amount of the invoice.
WHEN entry_type_label ("earned INCOME") THEN
"Recipes".
WHEN entry_type_label IN ('closing balance") THEN
"Closing balance.
ON THE OTHER
"Deferred income of credit."
END tag as,
entry_type_no,
orig_chg_start_date,
period_no,
-amt as amt
of revrec_test
WHERE acct_no = 1788562
AND IN (2, 4) entry_type_no (acct_no model dimension,
gl_code,
entry_type_label,
entry_type_no,
orig_chg_start_date,
period_no) measures (amt) rules upsert
all (amt 1788562,
' NON-10011561',
"Opening balance"
2,
2 OCTOBER 17 08.30.00 AM'.
190 = 0,
AMT 1788562,
' NON-10011561',
"Closing balance."
2,
2 OCTOBER 17 08.30.00 AM'.
190 = amt 1788562,
' NON-10011561',
"Deferred income of credit."
2,
2 OCTOBER 17 08.30.00 AM'.
190 - amt 1788562,
"WON-10011561',
"Revenue."
4,
2 OCTOBER 17 08.30.00 AM'.
190,
AMT 1788562,
' NON-10011561',
"Opening balance"
2,
2 OCTOBER 17 08.30.00 AM'.
191 = amt 1788562,
' NON-10011561',
"Closing balance."
2,
2 OCTOBER 17 08.30.00 AM'.
190,
AMT 1788562,
' NON-10011561',
"Deferred income of credit."
2,
2 OCTOBER 17 08.30.00 AM'.
191 = 0,
AMT 1788562,
' NON-10011561',
"Closing balance."
2,
2 OCTOBER 17 08.30.00 AM'.
191 =.
(amt 1788562, "UNEARNED-10011561',"Opening balance", 2,")
2 October 17 08.30.00 AM', 191 + amt 1788562, "UNEARNED-10011561',
("'Revenue deferred credit', 2, 08.30.00 October 2, 17 h", 191)-amt
1788562,
"WON-10011561',
"Revenue."
4,
2 OCTOBER 17 08.30.00 AM'.
191,
AMT 1788562,
' NON-10011561',
"Opening balance"
2,
2 OCTOBER 17 08.30.00 AM'.
192 = amt 1788562,
' NON-10011561',
"Closing balance."
2,
2 OCTOBER 17 08.30.00 AM'.
191,
AMT 1788562,
' NON-10011561',
"Deferred income of credit."
2,
2 OCTOBER 17 08.30.00 AM'.
192 = 0,
AMT 1788562,
' NON-10011561',
"Closing balance."
2,
2 OCTOBER 17 08.30.00 AM'.
192 =.
(amt 1788562, "UNEARNED-10011561',"Opening balance", 2,")
2 October 17 08.30.00 AM', 192 + amt 1788562, "UNEARNED-10011561',
"Revenue deferred credit", 2, 08.30.00 2 October 17: "(, 192)-amt"
1788562,
"WON-10011561',
"Revenue."
4,
2 OCTOBER 17 08.30.00 AM'.
192,
AMT 1788562,
' NON-10011561',
"Opening balance"
2,
2 OCTOBER 17 08.30.00 AM'.
193 = amt 1788562,
' NON-10011561',
"Closing balance."
2,
2 OCTOBER 17 08.30.00 AM'.
192,
AMT 1788562,
' NON-10011561',
"Deferred income of credit."
2,
2 OCTOBER 17 08.30.00 AM'.
193 = 0,
AMT 1788562,
' NON-10011561',
"Closing balance."
2,
2 OCTOBER 17 08.30.00 AM'.
193 =.
(amt 1788562, "UNEARNED-10011561',"Opening balance", 2,")
2 October 17 08.30.00 AM', 193 + amt 1788562, "UNEARNED-10011561',
("Revenue deferred credit", 2, 08.30.00 2 October 17: ', 193)-amt
1788562,
"WON-10011561',
"Revenue."
4,
2 OCTOBER 17 08.30.00 AM'.
193)
ORDER BY period_no, entry_type_no;
The query above works fine. But I hardcoded the values. I want to do the same operation for the other account number which will have different non periodical. How can I reach it?
Thanks in advance.
And why do you need a model for that? If I understand the reqs OK:
with t as)
Select acct_no,
"U-11561' gl_code,
"Deferred income credit ' entry_type_label,.
2 entry_type_no,
orig_chg_start_date,
period_no,
Max)
case entry_type_no
When 2 then - amt
0 otherwise
end
) amt,.
Description of the "invoice."
2 weight
from table_one
Acct_no group,
orig_chg_start_date,
period_no
Union of all the
Select acct_no,
gl_code,
entry_type_label,
entry_type_no,
orig_chg_start_date,
period_no,
-amt,
Description "paid the Bill."
3 weight
from table_one
where entry_type_no = 4
Union of all the
Select acct_no,
"U-11561' gl_code,
"Deferred income credit ' entry_type_label,.
2 entry_type_no,
orig_chg_start_date,
period_no,
AMT 0,.
case lvl
When 1 then 'account opening. "
of other "close account."
description of the end,
case lvl
When 1 then 1
another 99
end weight
from table_one,.
(select level lvl from dual connect by level<=>=>
Acct_no group,
orig_chg_start_date,
period_no,
LVL
)
Select acct_no,
gl_code,
entry_type_label,
entry_type_no,
orig_chg_start_date,
period_no,
case
what weight (sum) (1.99) can
case weight
When 2 then amt
When 3 then - amt
0 otherwise
end
)
During)
acct_no partition
order of period_no,
weight
)
AMT else
AMT of end,
Description
t
order of acct_no,
period_no,
weight
/
ACCT_NO GL_CODE ENTRY_TYPE_LABEL ENTRY_TYPE_NO ORIG_CHG_START_DATE PERIOD_NO AMT DESCRIPTION
------- ---------------------------- ----------------------- ------------- --------------------- --------- ---------- ---------------
1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 100 0 opening account
1001 U-11561 deferred revenue credit 2 Bill October 2, 17 08.30.00 AM 100 44
E-11561 1001 recipes 4 08.30.00 2 October 17: 100 13.87 paid invoice1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 100 30.13 closing account
1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 101 30.13 opening account
1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 101 0 Bill
E-11561 1001 recipes 4 08.30.00 2 October 17: 101 14,35 paid invoice1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 101 15.78 closing account
1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 102 15.78 opening account
1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 102 Bill 0
E-11561 1001 recipes 4 08.30.00 2 October 17: 102 14.83 invoice paid1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 102.95 close account
1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 103.95 opening account
1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 103 Bill 0
E-11561 1001 recipes 4 08.30.00 2 October 17: 103.95 invoice paid1001 U-11561 deferred revenue credit 2 2 October 17 08.30.00 AM 103 0 closing account
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 104 0 opening account
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 60 104 Bill
1002 fixed costs recurring revenue COA Code 4 09.30.00 November 17, 13 h 104 9.13 invoice paid1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 104 50.87 closing account
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 105 50.87 opening account
1002 U-11561 deferred revenue credit 2 December 20, 13 09.30.00 AM 105 50.87 opening account
1002 U-11561 deferred revenue credit 2 09.30.00 December 20, 13 h 105 19.24 invoice
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 105 0 Bill
1002 fixed costs recurring revenue COA Code 4 09.30.00 November 17, 13 h 105 44,91 paid invoice1002 fixed costs recurring revenue COA Code 4 December 20, 13 09.30.00 AM 105 - 7.82 Bill paid
1002 fixed costs recurring revenue COA Code 4 09.30.00 December 20, 13 h 105 3.93 invoice paid
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 105 29.09 closing account
1002 U-11561 deferred revenue credit 2 December 20, 13 09.30.00 AM 105 29.09 closing account
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 106 29.09 opening account
1002 U-11561 deferred revenue credit 2 December 20, 13 09.30.00 AM 106 29.09 opening account
1002 U-11561 deferred revenue credit 2 December 20, 13 09.30.00 AM 106 0 Bill
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 106 0 Bill
1002 fixed costs recurring revenue COA Code 4 09.30.00 November 17, 13 h 106 44,91 paid invoice1002 fixed costs recurring revenue COA Code 4 09.30.00 December 20, 13 h 106 11.75 invoice paid
1002 fixed costs recurring revenue COA Code 4 December 20, 13 09.30.00 AM - 23.47 106 paid
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 106-4.1 closing account
1002 U-11561 deferred revenue credit 2 December 20, 13 09.30.00 AM 106-4.1 closing account
1002 U-11561 deferred revenue credit 2 December 20, 13 09.30.00 AM 107 - 4.1 opening account
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 107 - 4.1 opening account
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 107 Bill 0
1002 U-11561 deferred revenue credit 2 December 20, 13 09.30.00 AM 107 Bill 0
1002 fixed costs recurring revenue COA Code 4 December 20, 13 09.30.00 AM - 13.69 107 paid invoice1002 fixed costs recurring revenue COA Code 4 November 17, 13 09.30.00 AM 107 35.91 invoice paid
1002 fixed costs recurring revenue COA Code 4 09.30.00 20 December 13 AM 107 6,86 invoice paid
1002 U-11561 deferred revenue credit 2 17 November 13 09.30.00 AM 107 - 33.18 closing account
1002 U-11561 deferred revenue credit 2 December 20, 13 09.30.00 AM 107 - 33.18 closing account47 selected lines.
SQL >
SY.
-
How can I change the value of a group of radio buttons to a bidding process?
I have an interactive report on page 1, and I'm passing the value of a column to the page of the two group of radio buttons.
I wish I could switch this radio group and pass the parameter currently displayed in the submission process:
#OWNER #. (CHPWD)
PUSERNAME = >: P2_USERNAME,.
PPASSWORD = >: P2_NEWPASSWORD,.
(PUNLOCK = >: P2_RADIO_LOCKED);
: P2_RADIO_LOCKED is not acquire any value that I can see.
Published by: xerosaburu on August 17, 2009 15:07
Published by: xerosaburu on August 17, 2009 15:08Hello:
You could modify the code for the page process of implantation of the rocker.
begin #OWNER#.CHPWD( PUSERNAME => :P2_USERNAME, PPASSWORD => :P2_NEWPASSWORD, PUNLOCK => :P2_RADIO_LOCKED); select decode(:P2_RADIO_LOCKED,'1','2','2','1) into :P2_RADIO_LOCKED from dual; end;
CITY
-
Is it possible to use the batch is script to retrieve the value window server political group?
Y at - it a batch command that will allow me to recover the value of group policy in Windows server? Something like gpedit.msc did, but I want because of the command line I want to convert this value to format I want.
Example: If I open gpedit.msc, then I go to Computer Configuration\Windows Settings\Security Settings\Local Policies\User Rights Assignment\Restore files and directories so I can get the value (administrators, backup operators) of this policy.
All ways in the batch script can bring me to this path and capture value?
Thanks, your help is very appreciated.
Hello
You could try to look at the list of Group Policy scripts or repost the question to the Scripting Guys or in Forum Windows Server forum.
-
How to retrieve the values of character without using single quotes
Hi all
How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL
Please answer me...
For example
Is actual query-> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);
I want to--> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.
Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.
shagarmahabubjan wrote:
Hi all
How to retrieve the values of character without the use of single quotes. Its Possible in Oracle SQL
Please answer me...
For example
Actual query is---> Select * from employees where name like in("SCOTT", "JAMES", "ALBERT",...);
I want to---> Select * from employees where name like(SCOTT, JAMES, ALBERT...); -without the use of single quotes.
Why I need this application, I need to retrieve the records more than 200 employees in a select statement by using name in where clause.
In short... you can't. The channels are channels, and SQL and PL languages dictate that the string literals are provided within single quotes.
I don't see how trying to retrieve more than 200 records of employees in the select statement means that you must get rid of the quotes.
Be clear in what you ask: Re: 2. How can I ask a question on the forums?
and take note of the FAQ link davidp provided the solution "variable IN the list.
-
How to get the value of the tree node without reloading the Page. !
Hello
I worked with apex 4.2 and I've created trees and as a table to retrieve the date according to the value of the tree node select the code tree something like that
{
Select case when connect_by_isleaf = 1 then 0
When level = 1 then 1
of another-1
end the status,
level,
'ENAME' as the title,
NULL as an icon,
'EMPNO' as value,
NULL as ToolTip,
' f ? p = 36648:34:5234984107903:P40_SELECTED_NODE :'|| EmpNo as link
"Dept". "" EMP ".
Start by "MGR" is nothing
connect prior "EMPNO" = "MGR".
siblings arrested by 'ENAME '.
}
and I put the Page selected node element: P40_SELECTED_NODE. the tree worked well and recover the data in tabular form according to the value of tree node
My Question:
1. I want to recover the data without submitting the page where whenever I select the value of the tree make page reload to update the tabular presentation with the new value, there is a way to convey the value of the tree node to point P40_SELECTED_NODE and in the form of refreshment without page reload.
2-i want when selected in the page tree run process according to the value of the on-set tree node to create dynamic action with (jquery selector: div.tree li > a) but the value of the incorrect node.
Concerning
Ahmed;Take a look at my sample tree application.
When you select a node, a details report is updated. That should help you implement for your situation.
However, one thing to note is the link on each node that you have. Click on a node to redirect to the same page and set the value of P40_SELECTED_NODE. You can keep the element, but the link should go, as it's him "reload" the page whenever you click on a node. Implementation of the action of "onselect" tree and setting the page element to the value of the node that will be in place. Be sure to add the page element in the elements present in the form of tables.
The reason why your selector didn't return the correct value is that you have a click event bound to the anchor tag in each element of the list. The anchor tag does not hold the real value (usually and id), but holds that the display value. The items list item containing the real value in their attribute "id". Therefore, to get this value you should always inspect the first parent of the clicked anchor tag. (which is another way to solve it, of course) -
You enter the value of the parent dimension
Hello
Once the dimension charge of OGL in Hyperion as well as hierarchy (parent with child relationship) is possible to enter values (financial data) for the ONLY parent in the dataform manually dimension?
If Yes, can you please suggest a way how to enter the values...You should probably use a version of target type to enter the higher levels
See you soon
John
http://John-Goodwin.blogspot.com/ -
Referencing of the values of the parent in the XML editor group
Hello
I have a report of EBS, who is out of the XML as follows:
But in my model, I actually want to 'flatten' the above so I can push in excel in the following format:<xmldata> <group1> <value1>Hello World</value1> <group2> <value2>Oracle</value2> <value3>Stuff</value3> <group2> </group1> <group1> <value1>Hello World</value1> <group2> <value2>Publisher</value2> <value3>More Stuff</value3> <group2> </group1> </xmldata>
The problem I have is that I have one for each course group2 to print these values, but then the values in Group 1 are not visible. So I just get white instead of value1. value2 and value3 work fine however.Hello World | Oracle | Stuff Hello World | Publisher | More Stuff
I tried things like
but it does not work - I have to do reference what parent level somehow, I'm looking at? I am using fields by the way, just used above for example.<?value1?><?value2?><?value3?>
Any pointers in the right direction would be really apreciated.
Concerning
JohnUse this:
.. alue1?=""?>
Thank you
Bipuser -
The value of Hours in specific groups of aggregate
First of all, I have some documents after you have used a SQL like this:
Just explain briefly,YEARS MONTHS SUMMONTH SUMQUARTER SUMYEAR ----- ------ -------- ---------- ------- 2009 Jan 153904 459909 1692462 2009 Feb 144643 459909 1692462 2009 Mar 161362 459909 1692462 2009 Apr 133407 423148 1692462 2009 May 148397 423148 1692462 2009 Jun 141344 423148 1692462 2009 Jul 136838 428743 1692462 2009 Aug 139550 428743 1692462 2009 Sep 152355 428743 1692462 2009 Oct 122030 380662 1692462 2009 Nov 121963 380662 1692462 2009 Dec 136669 380662 1692462 2010 Jan 139709 430608 1747257 2010 Feb 143226 430608 1747257 2010 Mar 147673 430608 1747257 2010 Apr 155311 441330 1747257 2010 May 143274 441330 1747257 2010 Jun 142745 441330 1747257 2010 Jul 137887 422751 1747257 2010 Aug 130827 422751 1747257 2010 Sep 154037 422751 1747257 2010 Oct 138790 452568 1747257 2010 Nov 162764 452568 1747257 2010 Dec 151014 452568 1747257
The column SUMMONTH is a dynamic that is the total value of a month
The column SUMQUARTER is a dynamic column means that the total value in a quarter of the year (January-March, April-June, July, sept, Oct - Dec)
The column SUMYEAR is a dynamic that is the total value of the year
In addition, the data (value) are calculated by each hour per day and combine them to a certain amount.
You can assume that the structure of the table have a field call 'HOURS', which has preserved a number (for example 00,01,02, 03,..., 21, 22, 23) and a 'VALUE' field that stored the data respectively.
This can be easy understand later with my SQL provided.
Now, the essential problem is "HOW to calculate a specific group of hours"...?
There are groups of serval of hours:
Group1. 08-20 (08:00-20:00)
Group2. 20 / 08 (20:00-08:00)
Group 3. 20-24 (20:00 to 12: 00)
Group 4. 24 / 08 (12:00 to 08:00)
You can see a little duplicated (Group2 = Group 3 and group 4) but it's ok...
Here's the SQL code that I use now:
Using a 'Q' parameter so I can force the month of a quarter...select years, months, summonth, sum(summonth) over(partition by years || to_char(ym, 'Q') order by years || to_char(ym, 'Q')) sumquarter, sumyear from( select years,months,summonth,sumyear,to_date(years || months, 'YYYYMon', 'NLS_DATE_LANGUAGE=American') ym from( select years, months, days, hours, mins, sumHour, SUM (sumHour) OVER (PARTITION BY years,months,days) sumDay, SUM (sumHour) OVER (PARTITION BY years,months) sumMonth, SUM (sumHour) OVER (PARTITION BY years) sumyear from (SELECT x.years, x.months, x.days, x.hours, x.mins, sum(x.value) as sumHour FROM xmltest, XMLTABLE ('$d/cdata/name' passing xmldoc as "d" COLUMNS years integer path 'year', months varchar(3) path 'month', days varchar(2) path 'day', hours varchar(2) path 'hour', mins varchar(2) path 'minute', value float path 'value' ) as X group by x.years, x.months, x.days, x.hours, x.mins order by x.years, x.months, x.days ) ) ) group by years,months,summonth,sumyear order by ym
but I don't really know how about the value of a specific group of hours group...
Output final format may be something like this:
Thanks that helps everyone!YEARS MONTHS SUMMONTH SUMQUARTER SUMYEAR 8AM_20PM 20PM_8AM 20PM_00AM 00AM_8AM ----- ------ -------- ---------- ------- ---------- ---------- ---------- ---------- 2009 Jan 153904 459909 1692462 15000 3904 3000 904 2009 Feb 144643 459909 1692462 2009 Mar 161362 459909 1692462 2009 Apr 133407 423148 1692462 2009 May 148397 423148 1692462 2009 Jun 141344 423148 1692462 2009 Jul 136838 428743 1692462 2009 Aug 139550 428743 1692462 2009 Sep 152355 428743 1692462 2009 Oct 122030 380662 1692462 2009 Nov 121963 380662 1692462 2009 Dec 136669 380662 1692462 2010 Jan 139709 430608 1747257 2010 Feb 143226 430608 1747257 2010 Mar 147673 430608 1747257 2010 Apr 155311 441330 1747257 2010 May 143274 441330 1747257 2010 Jun 142745 441330 1747257 2010 Jul 137887 422751 1747257 2010 Aug 130827 422751 1747257 2010 Sep 154037 422751 1747257 2010 Oct 138790 452568 1747257 2010 Nov 162764 452568 1747257 2010 Dec 151014 452568 1747257
Hello.
Here is a way.
WITH data AS ( SELECT '01' hour, 10 val FROM DUAL UNION SELECT '18' hour, 12 val FROM DUAL UNION SELECT '01' hour, 14 val FROM DUAL UNION SELECT '17' hour, 15 val FROM DUAL UNION SELECT '03' hour, 17 val FROM DUAL UNION SELECT '20' hour, 16 val FROM DUAL UNION SELECT '03' hour, 14 val FROM DUAL UNION SELECT '21' hour, 15 val FROM DUAL UNION SELECT '04' hour, 13 val FROM DUAL UNION SELECT '23' hour, 12 val FROM DUAL UNION SELECT '20' hour, 13 val FROM DUAL UNION SELECT '06' hour, 16 val FROM DUAL UNION SELECT '24' hour, 17 val FROM DUAL UNION SELECT '07' hour, 18 val FROM DUAL UNION SELECT '08' hour, 14 val FROM DUAL UNION SELECT '09' hour, 15 val FROM DUAL UNION SELECT '21' hour, 16 val FROM DUAL UNION SELECT '10' hour, 16 val FROM DUAL UNION SELECT '21' hour, 17 val FROM DUAL ), data_2 AS ( SELECT SUM(CASE WHEN TO_NUMBER(hour) BETWEEN 8 AND 20 THEN val ELSE 0 END) r8_20, SUM(CASE WHEN TO_NUMBER(hour) BETWEEN 20 AND 24 OR TO_NUMBER(hour) BETWEEN 0 AND 8 THEN val ELSE 0 END) r20_8, SUM(CASE WHEN TO_NUMBER(hour) BETWEEN 20 AND 24 THEN val ELSE 0 END) r20_24, SUM(CASE WHEN TO_NUMBER(hour) BETWEEN 0 AND 8 THEN val ELSE 0 END) r0_8 FROM data ) SELECT * FROM data_2; R8_20 R20_8 R20_24 R0_8 ---------- ---------- ---------- ---------- 101 222 106 116
I hope this helps.
Kind regards.
-
How to change without values, in addition to the values
Dear Experts,
In 10g am faing a question
in a column all values are less come, but I want to change the values at most and the grand total also, I want more values.
(there are here in DB without values)
Concerning
VijayClick on the fx of the column (assuming it isn't TANK) and enter:
(columnname) *-1
If some values are, but not all, enter this:
CASE WHEN columnname<0 then="" (columnname)*-1="" else="" columnname="">0>
Maybe you are looking for
-
Can I copy a DVD old House?
I have an old movie House DVD (not done on a Mac), shot in 2003, probably not too long after. I would like to cut the last 30 minutes of it, so I can copy the first mass party for parents (his karaoke like nobody wants to watch haha). Except that, I
-
Satellite L450D - 11V peripheral WLAN disappeared
My daughter has this laptop and lost features Wi - Fi during January 2010. I downloaded the latest BIOS and WLAN drivers, but the device is still missing in Device Manager. BIOS has active WLAN. The laptop is running Windows 7, and the device is a Re
-
What is the ram max usable in each grade in my 1119tx want m6 notebook
What is the ram max usable in each grade in my 1119tx want m6 notebook
-
Original title: receive in Microsoft Works Spreadsheet click on print, I receive this message. "Out of memory. Save or close any files or applications "Whats wrong?" Same as above
-
LOST MY IP TRYIN TO CONNECT TO THE CONNECTION
I LOST MY IP TRYIN TO CONNECT TO THE CONNECTION OUT OF TOWN, HOW DO I GET TO RECONNECT BACK TO WIRELESS. ___ PORTABLE STUDIO