How to get the consolidation at the level of the year-month?

Hi experts,

I have a column Date and quantity in the RPD. I created the column aggregated in RPD with aggregation Sum (the sum Qty)
My report is to come in this format...

Date of... Sum (Qty)
-----------------------------------
1/1/2009...5
1/2/2009...4
1/6/2009...10
2/3/2009...2
2/4/2009...6

But I need the report like this...

Year - my... Sum (Qty)
------------------------------------
2009-01-19
2009-02-8

Help, please

Hi bob,

(1) create a logical column yyyy/mm format using col date

CAST (EXTRACT (YEAR OF "Sample". » ». "" "" Samplesales '. "" Dim-Date '. (("" Start date ") as a CHARACTER (4)). '/' ||  BOX WHEN EXTRACT (MONTH OF "Sample". » ». "" "" Samplesales '. "" Dim-Date '. ("" Start date ") BETWEEN CAST and THEN 10 AND 12 (EXTRACT (MONTH OF"Sample". » ». "" "" Samplesales '. "" Dim-Date '. (("" Start date ") as a CHARACTER (2)) ELSE ' 0'.  CAST (EXTRACT (MONTH OF "Sample". » ». "" "" Samplesales '. "" Dim-Date '. (("" Start date ") as a CHARACTER (1)) END

(2) to adjust the level of the aggregate/content on this column format (yyyy/mm) to the fact table

Thank you
saichand.v

Tags: Business Intelligence

Similar Questions

  • How to get the Date, month, year of the DateTimePicker

    Hi, I am using the DateTimePicker.

    There are several question about this command:

    1. how to get the Date, month and year?

    -With the help of myDateTime.value, I get this string ' Wed May 08 14:45 ICT 2013 '-> I have to manually analyze this? Because I need in format yyyy/mm/dd. Or can set the format of dateTimePicker.value?

    2 format on dateTimePicker self (on the user interface) is d/m/YY, I can't change to another format?

    Thank you

    dateTimePicker.value return a QDateTime not a string.

    https://developer.BlackBerry.com/Cascades/reference/bb__cascades__datetimepicker.html#property-value

    See more:

    https://developer.BlackBerry.com/Cascades/reference/QDateTime.html#date

    https://developer.BlackBerry.com/Cascades/reference/QDate.html

    You can get

    day = dateTimePicker.value.date().day()
    month = dateTimePicker.value.date().month()
    year= dateTimePicker.value.date().year()
    dateYYYYMMDD = dateTimePicker.value.date().toString(Qt::ISODate)
    dateYYYYMMDD2 = dateTimePicker.value.date().toString("YYYY/MM/DD")
    dateYYYYMMDD3 = dateTimePicker.value.toString("YYYY/MM/DD")
    
  • How to get the previous month and year accordingly

    Hi friends,
    I wanted to select the month as a number like 4 and the new year 2011
    but I want to choose the previous month from sysdate
    as if the sysdate is June 10, 2011
    It should give me 5 months and
    in the year, it should give as 2011
    If the sysdate is January 1, 2012
    the month should be like 12 and year should be in 2011

    Thank you

    Hello

    776317 wrote:
    Thank you very much I just the 0 being the prefix... can you pls how to avoid that too well pls

    TO_CHAR ( ADD_MONTHS (SYSDATE, -1)
            , 'FMmm yyyy'
           )
    

    For more information on the FM, wee manual SQL language modifier works:
    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28286/sql_elements004.htm#sthref456

  • How to get the year of Date data

    Hi all

    I have the following scenario:

    County - Date - Code
    5 DS - 01/09/2009
    5 DS - 15/01/2009
    5 LO - 21/01/2009
    1. IT - 02/09/2009
    5 DS - 03/09/2009
    5 LO - 04/09/2009
    4 DS - 05/09/2009
    5 - IS - 06/09/2009
    5 DS - 07/09/2009
    5 - IS - 08/09/2009
    3 DS - 09/09/2009
    5 DS - 10/09/2009
    5 LO - 11/09/2009
    2 DS - 12/09/2009
    5 DS - 01/09/2010
    5 LO - 02/09/2010
    4 DS - 03/09/2010

    How can I only CDA data for 2009 and one year for 2010... Is meant by CDA 2009 data until the day of the date for example, if its 9 March today... TBE outcome will bring full jan, Feb and until the 9th day of March ' 09 and full jan, Feb and until the 9th day of March 10

    Thank you

    Published by: [email protected] on March 9, 2010 23:03

    Published by: [email protected] on March 9, 2010 23:06

    Something like:

    where dt <= trunc(dt,'YYYY')+(trunc(sysdate,'DD')-(trunc(sysdate,'YYYY'))
    

    "Dt" corresponding to your date column.

  • Suggest the Sql query to get the years, months, days of the two dates.

    Hi all

    SELECT TO_DATE('06-02-2014','DD-MM-YYYY') - TO_DATE('01-04-1998','DD-MM-YYYY') SERVICE_DAYS OF THE DOUBLE

    5790 SERVICE_DAYS

    POWER REQUIRED:
    YEARS MONTHS DAYS
    15 10 5

    OUTPUT DISPLAY:

    Select
    Floor(5790/ 365.25),
    Floor (mod (5790,365.25) / (365.25 / 12)),.
    ceil (mod(5790,365.25 / 12))
    Double;

    YEARS MONTHS DAYS
    15 10 7 - TWO DAYS MORE


    How they calculate manually is as follows:

    2014 02-06
    1998-04-01
    ---------------
    05 - days

    2014 02-06
    1998-04-01
    + 12
    ---------------
    10 month 02 is lower than 04, so we borrow 12 months of TI (2014) years will be (2013)

    2014 02-06
    1998-04-01
    -(1).
    ---------------
    15. for the years since we-1

    Kind regards

    Afzal.

    OK... so try not not to multiply the reminder to add_months with 30 but to solve the 'day-thing' in a different way...

    first step (data) is only my implementation testdata.

    WITH DATA AS (SELECT TO_DATE('02-03-2014','DD-MM-YYYY') AS Degnide

    TO_DATE('07-04-2008','DD-MM-YYYY') AS dayfrom

    OF the double

    UNION ALL

    SELECT TO_DATE('12-04-2014','DD-MM-YYYY') AS Degnide

    TO_DATE('11-05-1994','DD-MM-YYYY') AS dayfrom

    OF the double

    UNION ALL

    SELECT TO_DATE('06-02-2014','DD-MM-YYYY') AS Degnide

    TO_DATE('01-04-1998','DD-MM-YYYY') AS dayfrom

    OF the double

    )

    calc AS (SELECT months_between (dayto, dayfrom) SERVICE_DAYS

    Degnide

    dayfrom

    DATA)

    SELECT Degnide

    dayfrom

    floor(service_days/12) IN years

    floor (mod(service_days,12)) AS month

    , BUSINESS sign (EXTRACT (Degnide DAY) - EXTRACT (DAY FROM dayfrom))

    WHEN THEN-1 EXTRACT (DAY FROM Degnide) + 30 - EXTRACT (DAY OF THE dayfrom)

    WHEN 0 then 0

    WHEN 1 THEN EXTRACT (Degnide DAY) - EXTRACT (DAY FROM dayfrom)

    0 OTHERWISE

    end as days

    CALC

    HTH

  • How to get the year and month of a whole year

    Hello

    I have a list of selection and when the user selects the list values are like this 201101,201102,201103

    I tried like this


    declare
    T_DATE varchar2 (25);
    Start
    because me in 1.12 loop
    Select TO_CHAR (ADD_MONTHS (SYSDATE, + 1), "YYYYMM") in the double T_DATE;
    dbms_output.put_line (V_DATE);
    end loop;
    end;

    But its bad and I can not get clear idea where to change the code

    Thanks and greetings
    Srikkanth.M

    Srikkanth.M wrote:
    Hello

    I have a list of selection and when the user selects the list values are like this 201101,201102,201103

    If you want to list for the current year from Jan 201101,201102, 201103... 201112, then try this

    DECLARE
      v_Date  VARCHAR2(25);
      n_month NUMBER;
    BEGIN
      SELECT extract (MONTH FROM sysdate) INTO n_month FROM dual;
      FOR i IN 1..12
      LOOP
        SELECT TO_CHAR(ADD_MONTHS(SYSDATE, (i-n_month)), 'YYYYMM')
        INTO v_date
        FROM dual;
        dbms_output.put_line(v_date);
      END LOOP;
    END;
    

    Vivek L

  • How to get the format YYYYMM, regardless of the month

    Hello, I want to be able to get the year months '201401' format and 201402 regardless of what month is only for the current year.

    Select to_char (Trunc (add_months (sysdate-2), 'MM'), "YYYYMM") of the double

    output:

    201409

    But if I move to the next month and use the same command, the output displays 201410.

    So basically how I would change the query to select the format of yearmonth from Jan Feb 2014

    Hello

    You can do this by truncating the sysdate for the current year:

    TO_CHAR (trunc (sysdate, 'YEAR'), "YYYYMM"); - 201401

    TO_CHAR (add_month (trunc (sysdate, 'YEAR'), 1), "YYYYMM"); - 201402

    This help you?

    Cheerz,

    Stako

  • How to get the battery level and status in the cpp file?

    Hi all

    BatteryInfo class so I can I know how to get the battery level and the State in .cpp class?

    Hi Benecore,

    I have Add method below,

    #include

    But I only variable BatteryInfoPrivate not get variable BatteryInfo. You can also check on your side.

    So let me know how to get batteryInfo instance?

  • Cisco ASA5520 facing ISP with private IP address. How to get the IPSec VPN through the internet?

    / * Style definitions * / table. MsoNormalTable {mso-style-name : « Table Normal » ; mso-tstyle-rowband-taille : 0 ; mso-tstyle-colband-taille : 0 ; mso-style-noshow:yes ; mso-style-priorité : 99 ; mso-style-qformat:yes ; mso-style-parent : » « ;" mso-rembourrage-alt : 0 à 5.4pt 0 à 5.4pt ; mso-para-marge-top : 0 ; mso-para-marge-droit : 0 ; mso-para-marge-bas : 10.0pt ; mso-para-marge-left : 0 ; ligne-hauteur : 115 % ; mso-pagination : widow-orphelin ; police-taille : 11.0pt ; famille de police : « Calibri », « sans-serif » ; mso-ascii-font-family : Calibri ; mso-ascii-theme-font : minor-latin ; mso-fareast-font-family : « Times New Roman » ; mso-fareast-theme-font : minor-fareast ; mso-hansi-font-family : Calibri ; mso-hansi-theme-font : minor-latin ;}

    Hello guys,.

    I have Cisco ASA5520 facing the ISP with private IP address. We don't have a router and how to get the IPSec VPN through the internet?

    The question statement not the interface pointing to ISP isn't IP address private and inside as well.

    Firewall configuration:

    Firewall outside interface Gi0 10.0.1.2 > ISP 10.0.1.1 with security-level 0

    Firewall inside the interface Ethernet0 192.168.1.1 > LAN switch 192.168.1.2 with security-level 100

    I have public IP block 199.9.9.1/28

    How can I use the public IP address to create the IPSec VPN tunnel between two sites across the internet?

    can I assign a public IP address on the Gig1 inside the interface with the security level of 100 and how to apply inside to carry on this interface?

    If I configure > firewall inside of the item in gi1 interface ip address 199.9.9.1/28 with security-level 100. How to make a safe lane VPN through this interface on the internet?

    I'm used to the public IP address allocation to the interface outside of the firewall and private inside the interface IP address.

    Please help with configuration examples and advise.

    Thank you

    Eric

    Unfortunately, you can only complete the VPN connection on the interface the VPN connection source, in your case the external interface.

    3 options:

    (1) connect a router in front of the ASA and assign your public ip address to the ASA outside interface.

    OR /.

    (2) If your ISP can perform static translation of 1 to 1, then you can always finish the VPN on the external interface and ask your provider what is the static ip address assigned to your ASA out of the IP (10.0.1.2) - this will launch the VPN of bidirectionally

    OR /.

    (3) If your ISP performs PAT (dynamic NAT), then you can only start the tunnel VPN on the side of the ASA and the other end of the tunnel must be configured to allow VPN LAN-to-LAN dynamics.

  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • How to get the message to debug all to running page request OFA?

    Hello

    How to get the message to debug all to running page request OFA? do not use JDeveloper

    Thank you

    Renon,

    this.writeDiagnostics will be work AM and not CO. You mentioned that your code is AM, which is why I give (this.writeDiagnostics).

    You get an error when you use what to ? AM

    in CO, you must use pageContext. writeDiagnostics();

    You don't need to put any profile (other than DNF: Diagnostics), you just need to go to the Diagnostics - select the log on screen and choose the level that you used in the writeDiagnostics method.

    See you soon

    AJ

  • How to get the second and third weekend of every month over a period of time?

    Hello

    No idea how to get the second and third weekend of every month on a given period without use of CLAUSE?

    Thanks in advance.

    Try it below,

    SELECT CASE WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'SAT '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 1

    WHERE TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'Sun '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 6

    Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), "SAT") + 1

    END as second_weekendday,

    BOX WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'SAT '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 7

    WHERE TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'Sun '.

    THEN ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)) + 7

    Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), "SAT") + 7

    END AS third_weekendday

    FROM (SELECT SYSDATE startdate,

    SYSDATE + 300 enddate

    THE DOUBLE)

    CONNECT BY LEVEL<=>

  • How to get the last day of a month for every 2 months for a given period?

    Hello

    Can is it some please let me know how to get the last day, last day of the week, the weekend last day, last Monday, one month for every 2 months for a given period?

    Thanks in advance.

    Try the below

    SELECT LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))) lastday.

    BOX WHEN TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), 'DY') = 'SAT '.

    SO LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))-1

    WHERE TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), 'DY') = 'Sun '.

    THEN LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))-2

    Of OTHER LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))

    END as lastweekday,

    BOX WHEN TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), 'DY') IN ('Sam', 'SUN')

    THEN LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))

    Of OTHER LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))

    -(TO_NUMBER (TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))),' from)) - 1).

    END as lastweekendday,

    BOX WHEN TO_CHAR (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), 'DY') = 'MY

    THEN LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2)))

    Of OTHER NEXT_DAY (LAST_DAY (ADD_MONTHS (TRUNC(startdate,'MM'), ((LEVEL*2)-2))), "LUN")-7

    END AS lastmonday

    FROM (SELECT SYSDATE startdate,

    SYSDATE + 300 enddate

    THE DOUBLE)

    CONNECT BY LEVEL<=>

  • How to get the second Monday of each month in a given date range?

    In Oracle forms, how to get the second Monday of each month in a given date range?

    I tried below using the query WITH the Clause, but it seems that WITH Clause does not work in Oracle forms. So is there another way to do this in Oracle forms?

    WITH month_range AS

    (

    SELECT TO_DATE ('Dec 2013', 'Mon YYYY') AS first_month

    , TO_DATE ('Mar 2014', 'Mon YYYY') AS last_month

    OF the double

    )

    SELECT NEXT_DAY (6 + ADD_MONTHS (first_month

    , LEVEL - 1

    )

    , 'MONDAY '.

    ) AS second_monday

    OF month_range

    CONNECTION OF LEVEL < = 1 + MONTHS_BETWEEN (last_month, first_month)

    ;

    Thanks in advance.

    Good fishing, when the first day of the month is Thursday... So I changed the query accordingly... Try the below

    SELECT CASE WHEN TO_CHAR (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'DY') = 'game '.

    THEN NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'THU')

    Of OTHER NEXT_DAY (ADD_MONTHS (TRUNC(startdate,'MM'),(LEVEL-1)), 'Game') + 7

    END AS second_day

    FROM (SELECT SYSDATE startdate,

    SYSDATE + 300 enddate

    THE DOUBLE)

    CONNECT BY LEVEL<=>

  • How to get the date for the first Monday of each month

    Dear members,

    How to get the date for the first Monday of each month.

    I wrote the following code

    SELECT decode (to_char (trunc (sysdate + 30, 'MM'), 'DAY'), 'MONDAY', trunc (sysdate + 30, 'MM'), NEXT_DAY (trunc (sysdate + 30, 'MM'), "LUN")) FROM DUAL

    But he looks at complex bith.

    Abhishek

    Published by: 9999999 on 8 March 2013 04:30

    Use the IW format - it will make independent NLS solution. And all you need is truncated 7th day of each month using IW:

    select  sysdate current_date,
            trunc(trunc(sysdate,'mm') + 6,'iw') first_monday_the_month
      from  dual
    /
    
    CURRENT_D FIRST_MON
    --------- ---------
    08-MAR-13 04-MAR-13
    
    SQL> 
    

    Here is the list of the first Monday of the month of this year:

    with t as(
              select  add_months(date '2013-1-1',level-1) dt
                from  dual
                connect by level <= 12
             )
    select  dt first_of_the_month,
            trunc(dt + 6,'iw') first_monday_the_month
      from  t
    /
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-JAN-13 07-JAN-13
    01-FEB-13 04-FEB-13
    01-MAR-13 04-MAR-13
    01-APR-13 01-APR-13
    01-MAY-13 06-MAY-13
    01-JUN-13 03-JUN-13
    01-JUL-13 01-JUL-13
    01-AUG-13 05-AUG-13
    01-SEP-13 02-SEP-13
    01-OCT-13 07-OCT-13
    01-NOV-13 04-NOV-13
    
    FIRST_OF_ FIRST_MON
    --------- ---------
    01-DEC-13 02-DEC-13
    
    12 rows selected.
    
    SQL> 
    

    SY.

  • How to get the value of a * Global * Application point of JS

    If we declare an element of the request, which is NOT a level of the page in question, how we get the value of this element in an Action dynamic JavaScript on a page?

    For example, we declare a "global" variable as an Application named DEFAULT_AJAX_SEPERATOR and set its value with a calculation of the claim "on the new Instance" a moment later, on a page of the application, we would like to get the value of DEFAULT_AJAX_SEPERATOR via JavaScript.

    Page* level syntax element...
    $v( 'DEFAULT_AJAX_SEPERATOR' );
    .. How does not work. I don't understand why it's like $v can only access the elements on the page. However, the APEX is clearly able to get these global values since, for example, they are available in PL/SQL blocks. Also, I know that it is on the session object, because I can see it when viewing the session.

    So... What is sauce secret for obtaining this value?

    Thank you

    -Joe

    Hello
    Use something like this in your javascript code.

    var appItemVal = "& DEFAULT_AJAX_SEPERATOR.";

    Thank you
    Naidu789.

    If you think, I responded to your question, please mark as answer.

Maybe you are looking for