How to divide the monthly amount in weeks no fracture
Hi, I'm developing a quarterly report where there will be 13 weeks in a quarter (always) and the need to display amounts against only 13 weeks.
First month 4 weeks, 2 months 4 weeks and 3 months was 5 weeks all the time. I have a data dimension table that will tell me the number of the week (Col1) and the number of months (col2) this week belongs to...
My problem is that I have aggregated at the level of the month in the table amounts. I divide these monthly amounts in weekly amounts.
My data:
Data bucket | Quantities |
01/02/2014 | 15 |
01/03/2014 | 5 |
01/04/2014 | 4 |
Desired output:
Month | Week | Quantities |
01/02/2014 | 1 | 4 |
01/02/2014 | 2 | 4 |
01/02/2014 | 3 | 4 |
01/02/2014 | 4 | 3 |
01/03/2014 | 5 | 2 |
01/03/2014 | 6 | 1 |
01/03/2014 | 7 | 1 |
01/03/2014 | 8 | 1 |
01/04/2014 | 9 | 1 |
01/04/2014 | 10 | 1 |
01/04/2014 | 11 | 1 |
01/04/2014 | 12 | 1 |
01/04/2014 | 13 | 0 |
Thank you
Hello
To finish of Frank post (and using its formula), here's a way to get your results (and extend and adapt for your quarterly report):
WITH bucket LIKE)
SELECT ' 01 /' 02/2014 Mon, 15 amount OF double UNION ALL
SELECT ' 01 / 03/2014 ', 5 double UNION ALL
SELECT ' 01 /' 04/2014, 4 dual FROM
),
mm AS)
SELECT my, quantity, rownum bucket month_no
),
week AS)
N SELECT rownum FROM dual CONNECT BY level<=>=>
)
SELECT my 'months',
ROW_NUMBER() over (ORDER BY Mon, n) 'week ',.
WK n,
CASE
WHEN n<= mod="" (quantity,="" decode="" (month_no,="" 3,="" 5,="">=>
THEN CEIL (quantity / DECODE (month_no, 3, 5, 4))
ANOTHER FLOOR (amount / DECODE (month_no, 3, 5, 4))
END "quantities".
OF the week, mm
WHERE month_no = 3
OR (month_no (1,2) AND n)<=>=>
)
ORDER BY month_no, wk;
Tags: Database
Similar Questions
-
How to calculate the number of days/weeks/months between 2 dates?
Hello
I would like to know how to calculate the number of days/weeks/months between 2 dates in OBIEE 11 g, for example, I have 26/05/2013 and 19/05/2013, then I want to get 7 days.
Thank you!
JamieHi Jamie,
Through this links...
http://www.bravesoft.com/blog/?p=682
http://twobiee.blogspot.in/2012/01/working-with-date-differences.htmlMark as correct it allows u...
Thank you... -
How to divide the column Date OBIEE
Hello
We have the name of the date column: To_Date and the format is DD/MM/YY hh.
How to divide the date in YEARS, MONTHS, DAY as new columns.
kindly help on that.
Kind regards.
CHR
Published by: 867932 on November 23, 2011 22:18Hi user,
All 3 functions can be written in RPD too. MDB layer, duplicate the date column-> the mapping tab to column of Goto-> expression-> functions Builder Select-> calendar Date functions / hour-> select DayofMOnth function. The column of your logic formula will look like,
DayofMonth (YourDateColumn)
Rgds,
DpKa -
How to view the monthly/annual statistics in terms of time past/calories burned, broken down by each individual activity such as run elliptical/outside etc. Y at - it a third party application that can help me to collect and display these data?
Hello
It is not currently possible to review the data the application integrated in activity or training on this basis. If you want Apple to consider adding this feature, you can suggest here:
https://www.Apple.com/feedback/watch.html
However, health and fitness data from other sources, iPhone, and Apple Watch are registered and grouped within the health on iPhone app. These data can be exported, which you may find useful to track the cumulative progress and/or analyze your activity more in detail.
IPhone app activity also has a button for sharing (top right of the screen) that allows to share data - including social media, Messages, Mail, Notes, and a printer.
Include third-party applications that can be useful, for example:
Access to QS
-"Access your HealthKit data in a table so you can Explorer using numbers, Excel, R, or any other tool compatible CSV."
- https://itunes.apple.com/gb/app/qs-access/id920297614?mt=8
SpectaRun workouts
-"View from the workouts of your Apple Watch on your iPhone and to export these workouts so you can download them to your favorite online running community."
- https://itunes.apple.com/gb/app/spectarun-workouts/id991723862?mt=8
Data can also be exported directly from the application of the health (Health Data > All - Share at the top button on the right).
Check the descriptions and support resources for third party applications for supported details of import and data analysis features.
More information:
Use the activity on your Apple Watch - Apple Support
-
Hi all...
Here, I use the following scripts...
create table a10 (eno number, date f, date t, number of sal)
INSERT IN A10 (ENO, F, T, SAL) VALUES)
1, TO_Date (1 July 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (June 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')
(100);
INSERT IN A10 (ENO, F, T, SAL) VALUES)
1, TO_Date (May 1, 2013 12:00:00 AM ',' DD/MM/YYYY HH: mi: SS AM'), TO_Date (April 30, 2014 12:00 ',' DD/MM/YYYY HH: mi: SS AM')
(200);
COMMIT;
entry:
ENO F T SAL
07/01/2013 2014/06/30 100 1
1 05/01/2013 30/04/2014 200
Expected results:
ENO F T SAL 1 05/01/2013 2013/06/30 200
1 30/04/2014 300 07/01/2013
1 05/01/2014 2014/06/30 100
I'm little bit confused how to divide the dates here... Any help is appreciated.
Thank you all
Stéphane
Hello
Always tell what version of Oracle you are using, especially if it's so old.
In Oracle 10 (or 9, by the way) you can do this way:
WITH cntr AS
(
SELECT LEVEL AS n
OF the double
CONNECT BY LEVEL<=>=>
)
got_change_date AS
(
SELECT d.eno
C.n
WHEN 1 THEN f
ANOTHER t + 1
END AS change_date
C.n
WHEN 1 THEN 1
OF ANOTHER-1
END as mul
sal
BY a10 d
CROSS JOIN cntr c
-WHERE... - If you need any filtering, put it here
)
got_total_sal AS
(
SELECT eno
change_date f
Advance (change_date) OVER (PARTITION BY eno
ORDER BY change_date
) - 1 AS t
SUM (sal * mul) over (PARTITION BY eno
ORDER BY change_date
) AS total_sal
OF got_change_date
)
SELECT *.
OF got_total_sal
WHERE t IS NOT NULL
ORDER BY eno, f
;
-
How to calculate the month on month growth rates in an OBIEE application?
Hi all
I would like to ask for your help on how to calculate the months on growth rate previous/[(last month-previous month) month * 100%] in a query OBIEE. This report should always be calculated for the last 2 months available.
I have the following query:
Month0 | Months1. Month2
Produces a 500 | 100. 200
Product B 600 | 300. 150
I would like to add month on month column as follows:
Month0 | Months1. Month2. Month on Month (%)
Produces a 500 | 100. 200 | + 100.00%
Product B 600 | 300. 150. -50.00%
I tried to add a calculated item, but it failed because I couldn't find a way to not show the column calculated in percent with 2 decimal places. In addition, I would ideally prefer to have an automatic update but as far as I understand it can be done in the automatically calculated item
I also tried to add a new column to the column area and to filter the results for the last month, then for the previous month and then based on that to calculate the necessary ratio but unfortunately it does not work.
Thank you in advance your adviceHello
The best way to solve this problem is by using the function Ago. With this, you can create a logical column for the previous month. Then you will have 2 columns available with which you can do your calculations.
If you want to do this with a calculated item (don't know if formatting will work for you), but you can do the more general calculation using $1 for the $2 for the 2 column and 1 column in your calculation. If ($x) columns will change with the columns in your report.
Concerning
-
How to divide the amount of import control program command line
Hi Experts
Divide the amount of command-line client 102000 99000 and 3000.
I used following scripts, but he just updated the quantity on the line, but do not add a new line for the remaining quantity.
1 INSERT IN oe_headers_iface_all
(
order_source_id,
orig_sys_document_ref,
org_id,
ORDER_NUMBER,
CUSTOMER_PO_NUMBER,
SOLD_TO_ORG_ID,
CLIENT_NAME,
CUSTOMER_NUMBER,
OPERATION_CODE,
created_by,
CREATION_DATE,
last_updated_by,
last_update_date,
CHANGE_SEQUENCE,
FORCE_APPLY_FLAG
)
VALUES)
0,
"LT_TEST7,"
204,
67081,
"4500007067-01',
1290
"Networks of c. a.",
'1143 ',
"UPDATE."
-1,
SYSDATE,
-1,
SYSDATE,
1,
« Y »
);
2. INSERT IN oe_lines_iface_all
(
order_source_id,
orig_sys_document_ref,
orig_sys_line_ref,
orig_sys_shipment_ref,
org_id,
ORDERED_QUANTITY,
ORDER_QUANTITY_UOM,
PRICING_QUANTITY,
PRICING_QUANTITY_UOM,
SOLD_TO_ORG_ID,
REQUEST_DATE,
INVENTORY_ITEM,
created_by,
CREATION_DATE,
last_updated_by,
last_update_date,
operation_code,
CHANGE_SEQUENCE,
CHANGE_REASON
)
VALUES)
0,
"LT_TEST7,"
"LT_TESTLINE7,"
"OE_ORDER_LINES_ALL810289.1,"
204,
99000,
"Ea."
99000,
"Ea."
1290
AUGUST 13, 2014 '.
"AS54888,"
-1,
SYSDATE,
-1,
SYSDATE,
"UPDATE."
1,
'FR '.
);
3. INSERT IN oe_lines_iface_all
(
order_source_id,
orig_sys_document_ref,
orig_sys_line_ref,
orig_sys_shipment_ref,
org_id,
ORDERED_QUANTITY,
ORDER_QUANTITY_UOM,
PRICING_QUANTITY,
PRICING_QUANTITY_UOM,
SOLD_TO_ORG_ID,
REQUEST_DATE,
INVENTORY_ITEM,
created_by,
CREATION_DATE,
last_updated_by,
last_update_date,
operation_code,
CHANGE_SEQUENCE,
SPLIT_FROM_LINE_REF,
SPLIT_FROM_SHIPMENT_REF,
CHANGE_REASON
)
VALUES)
0,
"LT_TEST7,"
"LT_TESTLINE7,"
"OE_ORDER_LINES_ALL810289.1,"
204,
3000,
"Ea."
3000,
"Ea."
1416,
"05 - SEP - 2014."
"AS54888,"
-1,
SYSDATE,
-1,
SYSDATE,
"INSERT."
1,
"LT_TESTLINE7,"
"OE_ORDER_LINES_ALL810289.1,"
'FR '.
);Any advice?
Christy
Hi all
The problem was resolved after customer compensation request_id in the header and line, thanks for your help.
Christy
-
How to divide the three PARTITION HD
I bought the new PC HP 1350EJ G6
and
I would like to divide the PARTITION HD 3: Application of the system, Document,
Please how can I do?
Thanks much AVI kl
{Information}
Going to be hard to do since you already have 4 primary partitions. See the link below
-
Do I have to pay extra for each application after you already paid the monthly amount?
I paid $79.98 for a monthly amount that is said in my mail that it includes all Apps + Adobe Stock. Then when I update an access point (example: indesign) it says start free trial. I then clicked on it and then it gives me an option to buy... do I have to pay an extra $?
No, the updates and upgrades are included in your monthly subscription.
-
How to divide the Panel layer in two?
How do divide you the layers panel in half? I've seen references to do this but Googling this question does not work.
I use CS2
Far as I can tell that the person referred to the screenshot of the layers panel appeared in the article, not the real layers panel in Photoshop.
-
How everyone counts the total amount of GHz for virtual machines on a host-cluster?
Hello
I want to do some basic sizing and I may\may do not go the way to write about it. For example, suppose I have a cluster of 4 nodes with a total of 200GHz and 1 TB of RAM on all four hosts with 100 VM. How can I get the total amount of GHz\Memory that each virtual machine is configured with (not necessaryly to aid real-time) so that I can workout or demonstrate what fits on one or two hosts in the cluster, for example?
Thanks for your help and advice in advance
You can do this via the inventory tool called RVTOOL which allow you to do an inventory of all your virtual machines and hosts with the resource assigned and served. hope, it will help you.
-
How to divide the Recordset by groups in SQL itself.
Hi, I use 10.2.4.0 Oracle.
I have only one requirement, to whom I have to divide the recordset in some groups, so that they can be executed in part, but not in a single pass.
So, in the 'SELECT' clause itself I want to asssign special value (can be 1) to 50000 first then saves another value (maybe 2) to 10000 next, like wise. And yet once the total number of records will also be successive varry, if the total number of recordset is less than 10,000, then it should only affect '1' to all records. I'll put the values of the Group (1,2,3...) as another column itself.
Can you please let me know if this can be done in SQL without going for PLSQL?Hello
This is called a Query of paging , and here's a way to do it:
WITH got_grp AS ( SELECT x.* , CEIL ( ROW_NUMBER () OVER (ORDER BY x_id) / 50000 ) AS grp FROM table_x x -- WHERE ... -- If you need any filtering, put it here ) SELECT * -- Or list the columns you want FROM got_grp WHERE grp = 1 ;
ROW_NUMBER () OVER (ORDER BY x_id) assigns unique integers 1, 2, 3,... to all of all lines, in the same order as x_id (even if x_id is not unique).
CEIL (ROW_NUMBER () OVER (ORDER BY x_id) / 50000) maps the 1st 50,000 of these numbers to 1, the 2nd 50 000 votes against 2 and so on.
Calculated analytical (like ROW_NUMBER) as functions after the WHERE clause is applied, so to use the results in a WHERE clause, then you need calculate their in a subquery. If you want to just display the number and not use in a WHERE clause, so you need not a subquery.I hope that answers your question.
If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and the results desired from these data.
In the case of a DML (UPDATE), for example, the sample data should show what looks like the tables before the DML, and the results will be the content of the or the tables changed after the DML.
Explain, using specific examples, how you get these results from these data.
Always tell what version of Oracle you are using.
See the FAQ forum {message identifier: = 9360002} -
How to divide the resultset SQL based on the data in the form of scenarios?
Hello
I need to develop a query that should be divided into scenarios
Ex:
Scenario 1: If a product is sold to the United States and charged in the United Kingdom
Scenario 2: If a product is sold to the United Kingdom and charged in the United States
Scenario 3: If a product is sold and invoiced to the United States
Scenario 4: If a product is sold and invoiced to the United Kingdom
Based on 1 how to divide and provide SQL result to users based on the scenarios?
Ex: Result should show all the data, saying that the result set is in scenario 1, etc..,.
Please advice
Thank you
user12048986Hello
You can use an expression BOX to classify each line:
CASE sold_country || ' ' || billed_country WHEN 'US UK' THEN 1 WHEN 'UK US' THEN 2 WHEN 'US US' THEN 3 WHEN 'UK UK' THEN 4 END AS scenario_num
If sold_country or billed_country is anything except 'UK' or 'US', then the above expression returns null.
I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements), and the results you want from this data. -
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 divide the characters in table 1 d
I am looking for a way to divide the 'print' to a string 1-d subarray. For example instead of:
1 / AAAABBBB
2 / CCCCDDDD
3 / EEEEFFFF
...
etc.
then there would be two tables 1 d separated where before there was a:
1 / AAAA and BBBB
2 / CCCC and Delalande
3 / EEEE and FFFF
...
etc.
Something like that?
You need better on where the split to take place? I doubt somehow you want just a simple divided into a constant place.
Maybe you are looking for
-
How do I exit Application user settings of cluster event?
Could someone tell me please how to get the icon to Application Quit event in a cluster? (similar to that of the user in the event Callbacks.vi settings cluster set up in the OI Simple TestStand shown here). I'm trying to change the event Callbacks.v
-
LENOVO THINKPAD X 201 good for computer programming?
I'll specialize in computer programming and want to know if it's a good laptop for computer programming. I'm not a gamer but I heard that the graphics are important and that "integrated" graphics are not good. It would be a problem for me? If it help
-
Smartphones blackBerry on PC Backup is not complete
Latest version of the desktop software. Stops at 98%, while 'Backing up Smart Card Options 1 of 1 Record'. Never finished, cancel does not work. Need to remove the USB cable to stop the process, no file is placed in the backup folder. HE USED TO
-
I used Adobe Creative cloud as an amateur for a few years but have not had the chance to use the suite for several months because of changes in my personal life.I decided to cancel my subscription since my membership is quite a lot of money thrown ou
-
Provision of servers across the Web using VMware View 4.0
HelloI have an obligation to provide servers via http. I have the license for Vmware View, but have no idea where to start? I installed view a server in the DMZ, but we must talk back to the field so I put discarded it.My ultimate goal is to open a w