How to calculate this column (the last week of the month)?

I have a request where it shows a few months of calculations of sage

ex. This report is for Dec-2010

statement line. A reduced rate. Approved rate. Last week declined the rate |
-------------------------
Asia report | ------20%----- | -----45%-------- | --------4%------ |
Africa report | ------44% -----| -----21%-------- | ------12%-------|

I'm figuring the column rate declined last week . The logic is simply not coming to my mind.
Can someone suggest me how can I calculate this?

We'll see. This report at any time after the previous month running has closed...

(1) TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE) will give you the last day of the previous month.

(2) TIMESTAMPADD (SQL_TSI_DAY, DAYOFWEEK (TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE)) *-1, TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE)) will give you the Saturday before the last week of the month.

(3) TIMESTAMPADD (SQL_TSI_DAY, 1, TIMESTAMPADD (SQL_TSI_DAY, DAYOFWEEK (TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE)) *-1, TIMESTAMPADD (SQL_TSI_DAY, (DayOfMonth (CURRENT_DATE)) *-1, CURRENT_DATE))) will give you the Sunday of the last week of the previous month.

Now that you have the start of the last day of the previous week, you can create your filter... It will be "(between 3) and 1)" above... "

Tags: Business Intelligence

Similar Questions

  • I want images in CMS format, but it only helps to px, how can do this, on the publishing server?

    Hello

    I want images of size by bu cemtimeters it only lets px, how can do this, on the publishing server? Thank you

    Daisy

    Original title: size

    You can do it with this freeware tool.
     
  • On the Windows start page, photos of key shortcut icon keep Disappearing, failed to peak of the icon of Firefox. How can I stop this and make the pictures remain, as before. This just started last week.

    On my screen shortcut keys don't contain their individual icon pictures, until I have sign, back in market, or Clear My Temporary Files, etc. Then they all go to the Firefox default image. I also noticed that when I navigate using firefox, immediate shows NO icons next to some of the web addresses Web site, Instead showing a drop-message that the website offers no identity Info, which I know is wrong!
    This has only been happening for a week or So.
    Please, please, please help me!
    Thanks in advance for your kindness and help. I am a Novice at this stuff!
    See you soon!
    ;-)

    Hello

    I imagine the inconvenience that you are experiencing. I'll certainly try and help you fix the issue; However, I will need to ask you a few questions.

    1. what version of IE are you using?

    2 do you have of them pack installed?

    3. do you have an antivirus installed on the computer?

    4. do you also deal with any show related to problems with the computer?

    5. are you aware of any changes made to the computer before the show?

    First of all, you can run a full scan using the Microsoft Safety Scanner.

    Note: there is a risk of data loss if all the files are infected and which can be removed in the cleaning process.

    You can then try to launch the FIXIT of the article and see if it helps. Also go through the steps in this article as well and check it out.

    If you try the manual steps, do not forget to back up the registry.

    Registry warning

    To do: Important this section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    http://support.Microsoft.com/kb/322756/

    Hope this has been helpful and let us know if you need more assistance. We will be happy to help you.

  • I have a document shared in the cloud. When users click the link, they see a column on the right of the document's details. How to hide this column (at least on the first charge)?

    Hello

    I would prefer that users who click on the link I send do not see the right column of document's summary information. Can I hide it? It is in order of appearance, no secret.

    Unfortunately, there is no way for you, the sender, to remove this default. I will submit your request to the product team.

    There is a way for the recipient to hide the right panel. Simply click on this button:

    (I realize that this is not what you're asking, but thought I would mention it.)

  • Tecra S2: Using FN + F8 - how to do this in the software?

    Hello
    I was wondering if anyone has found a way of software utility to turn on the power switch (NOT the switch h/w) Radio.

    It's easy on some other Toshiba laptops not - I checked on TaskMgr and he told me EXACTLY what the program is short, which can be called directly to the extension for active / disable Radio (as another shortcut).

    Of course, by telling users to use the FN + F8 is perhaps one thing... but how about a shortcut in our set of cordless tools?

    And why confuse with a HARDWARE switch and then also a SOFTARE option as well!
    If at least the Fn + F8 could be emulated, it would be possible for a reminder on forcing the h/w switch is off, or the s/w radio is turned off, or maybe it is not disabled at all!

    Anything either would be useful... a vb send the keys like a piece of code, or the mobile extensions or a specific utility that could be called to turn.
    So far, all I can do is say "make sure you press FN + F8".

    I found various tools that control the ability to receive service (E - Key and TfncKy) entries, but no documentation on any way I could manipulate them.

    It relates to a business for the mobile and wireless strategy that may affect our to forward to the future with Toshibas as well any help appreciated.
    That's the problem with WiFi stuff... much too complex for its own good and that you omit things easy.

    I just need a way to turn the radio power at the level of the system. Help, please.
    Any help kindly received if Toshiba officially or not.

    [Edited by: admin]

    Hello

    Usually, Toshiba Hotkey utility is responsible for the use of the FN keys.
    I think Toshiba programmers have designed this utility for Toshiba laptops and the FN key utility can only be used on Toshiba laptops. Do not think that the 3rd party application will work.

    Maybe it of possible to write an application that can change the FN key, but you will not be able to find any caregiver of this forum.
    You should visit a programmer forum.

  • I just installed an additional printer. How to make this printer the DEFAULT printer

    Just installed an additional printer. How do I do this the DEFAULT printer.

    I moved your question in the comments of answers box, even if you do not specify your version of Windows.

    Control Panel configuration/Printers (or printers and devices)
    Right click on the new printer, select set as default.
    -steve
  • How to do this in the scheme star

    Hi experts

    I have 4 tables I want to turn in a star schema.

    Table1 (FACT) has a n: 1 to table2 (Sun)

    Table2 (Sun) also has 1:1 table3 (Sun) and 1:1-table4 (Sun)

    Is it possible to reproduce this in a star schema where table1 (fact) is a relationship n: 1 for all tables (dimensions)?

    I have that modeled in the administration tool and all queries between table1 and table 2 work, but they are not if I involved table 3 and 4.

    Not sure how to define the relationships of 1-to-1 in the physical layer.

    see you soon

    Tim

    Hello, Tim! :)

    I hope this helps...

    If you really want to make a star from the physical layer schema, I would say that you consolidate your tables in one dimension only, if they do not contain a lot of data. If it contains a large amount of data, however, I would also say that you treat your fact table so that it contains foreign keys to those of all the three dimension tables, so it could connect to them on its own. Given all the dimension tables are 1-1 relationships, the two suggestions can be relatively easy to map.

    See you soon!

    -Cha :)

  • I can't download my pictures from my camera or from disk. I get an error code. Someone knows how to fix this? The error code is 0 x 80010108

    I can't download my pictures from my camera or from disk.
    I get an error code. Ox80010108
    Any help? Enjoy

    Hello

    1 when you download the pictures?

    I suggest that you put the computer to boot and then try to upload the image, follow step 1 to set the computer to boot.

    How to troubleshoot a problem by performing a boot in Windows Vista or in Windows 7 http://support.Microsoft.com/kb/929135
    Note: After the boot minimum troubleshooting step, follow step 7 in the link provided to return the computer to a Normal startup mode.

  • How to solve this error "the game met a fatal DirectX issue while trying to start. Try a different screen resolution or bit depth. If this does not work, try new video drivers. »

    Hi all

    I get the following error every time I try and start Asherons call on a new Dell Latitude E5510 laptop.

    The game has encountered a fatal DirectX problem trying to start.
    Try a different screen resolution or bit depth. If this does not work, try new video drivers.

    This error occurs just after clicking the world to enter.

    • I have a fresh install of Win7 64 bit (entirely the window update)
    • The latest Intel HD - v8.15.10.2622 01/10/2012 graphic card driver.
    • A sweet DX 9 and DXDiag and 11 installation reports no errors.

    I lowered res video and depth of color, but without result.

    Digitized internet and found others with the issue but no resolution, I could see.

    Anyone have any ideas/suggestions?

    I love a solution restored for the following driver and the problem resolved.

    V8.15.10.2599 21/10/2011

  • How to achieve this using the sql query?

    Hello gurus,

    I have a table like this
    id    name
    1       a
    2       b
    3       c
    4       d
    5       e
    6       f
    7       g
    8       h
    9       i
    10     j
    11     k
    12     l
    13     m
    now my result should be like this
    id    name  id   name   id   name 
    1       a     6       f      11     k
    2       b     7       g     12     l
    3       c     8       h     13     m
    4       d     9       i
    5       e     10      j
    How to achieve by sql query?

    Thank you and best regards,
    friend

    Edited by: most wanted! February 22, 2012 05:55

    Hello

    Did you mean this:

    with a as
    (select 1 id ,'a' name from dual
    union all select 2 id ,'b' name from dual
    union all select 3 id ,'c' name from dual
    union all select 4 id ,'d' name from dual
    union all select 5 id ,'e' name from dual
    union all select 6 id ,'f' name from dual
    union all select 7 id ,'g' name from dual
    union all select 8 id ,'h' name from dual
    union all select 9 id ,'i' name from dual
    union all select 10 id ,'j' name from dual
    union all select 11 id ,'k' name from dual
    union all select 12 id ,'l' name from dual
    union all select 13 id ,'m' name from dual
    )
    
    select
      id_1
      ,name_1
      ,id_2
      ,name_2
      ,id_3
      ,name_3
    
    from
      (
      select
        id id_1
        ,name name_1
        ,lead(id,5) over (order by id) id_2
        ,lead(name,5) over (order by id) name_2
        ,lead(id,10) over (order by id)  id_3
        ,lead(name,10) over (order by id) name_3
        ,rownum r
      from
        a
      )
    where
      r <=5
    
    D_1                   NAME_1 ID_2                   NAME_2 ID_3                   NAME_3
    ---------------------- ------ ---------------------- ------ ---------------------- ------
    1                      a      6                      f      11                     k
    2                      b      7                      g      12                     l
    3                      c      8                      h      13                     m
    4                      d      9                      i
    5                      e      10                     j 
    

    Kind regards

    Peter

  • Old computer with Photoshop is dead, had to buy a new computer.  How to install this on the new computer?  I do not have a disk, I bought online.  I looked in my account shows, I bought it, but don't see an option for installation.

    I do not have a disk, I bought online.  I looked in my account shows, I bought it, but don't see an option for installation.

    You can do so here:

    Download Photoshop Elements products | 10, 11, 12, 13

  • How to calculate the percentage of monthly sales

    Hello

    I have a column sales of the month and I have another column that calculates (monthly sales / (total number of monthly sales)) * 100.

    How to calculate this percentage of sales.

    Please advice.

    Kind regards

    Séverine.

    You can use the AGGREGATE function for the TOTAL monthly sales in the year:

    Something like: AGGREGATE ("measure monthly sales" to "Time" ".") Time hierarchy ".» An »)

    Calculate your final formula:

    "measure the monthly sales" / AGGREGATE ("measure monthly sale 'to"time'." Time hierarchy ".» Year') * 100

  • How to calculate the 99th percentile of a stream of number...

    Environment:

    Oracle 11.2.0.3 EE on Solaris 10.5

    I have a stream of numbers (for example 1000), I need to calculate the 99th percentile of the distribution of this stream in such a way that when a new ' number is introduced, I can tell if the new number is above the 99th percentile of the distribution of my workflow.

    I don't have a good idea of the nature of the distribution if it's important.

    I am NOT, I repeat NOT a statistician! :-)

    I read the docs on the different functions available, ntile, percent_rank, percentile_cont, percentile_disc, etc. I also read a lot of articles referenced via Google.

    The examples are not exactly what I'm trying and I was unable to get the result I need by trial and error (mostly!).

    All suggestions are welcome!

    If you need additional information, I will try to provide what I know.

    -gary

    Hi, Gary.

    garywicke wrote:
    Hi Frank

    Well to try to facilitate the description of periods, I managed to confuse the issue a little more.

    Sorry about that.

    I need to use days not months. The script will be executed every day and watch period of ago 210 days to 31 days following there from 30 days at present.

    With respect to the expected result, I need somehow calculate what turnover represents the 99th percentile (or 90th everything that works in the example) and store that in my table of this customer.

    Then after a CREATE TABLE statement for this table and you want that it contains, given the data published in the sales table, after it is filled.

    Another process on the whole will consider the last average of 30 days and determine if this average exceeds sales 99th percentile figure and initiate an action (alert email, etc.) if it is.

    My problem is that I don't know how to calculate this 99th percentile number.

    After the sample data, I'm guessing it should be close to the number of SD 3, but after reading your comments, maybe that's not correct.

    That's my guess. Sometimes deviations corresponding to percentiles, sometimes they did not. People choose one or the other, depending on what amounts to their data, and what they want to show on these data. Your client has apparently chosen percentile. Unfortunately, we do not seem to know something about the problem.
    Before you can solve this problem for your customer, you must understand what the problem is. Talk to your client and know exactly what is wanted here.

    Here is one possible approach.

    WITH     got_month_avg     AS
    (
         SELECT       custno
         ,       AVG (amount)     AS month_avg
         FROM       sales
         WHERE       tran_dt     >  SYSDATE - 30
         AND       tran_dt     <= SYSDATE
         GROUP BY  custno
    )
    ,     got_threshold_amount     AS
    (
         SELECT DISTINCT
              custno
         ,     PERCENTILE_CONT (.4)          -- or .99
                  WITHIN GROUP (ORDER BY  amount)
                            OVER ( PARTITION BY  custno )          AS threshold_amount
         FROM    sales
         WHERE     tran_dt     >  SYSDATE - 210
         AND     tran_dt <= SYSDATE -  30
    )
    SELECT       a.custno
    ,       a.month_avg
    ,       t.threshold_amount
    FROM       got_month_avg          a
    JOIN       got_threshold_amount  t  ON  t.custno  = a.custno
    --WHERE       a.month_avg     >= threshold_amount
    ORDER BY  custno
    ;
    

    Output:

    `   CUSTNO  MONTH_AVG THRESHOLD_AMOUNT
    ---------- ---------- ----------------
             5      126.5           4812.6
            26 4602.44444           3102.2
    

    I set the WHERE clause comment, just so that we could see the results of each custno. I also put the extremely low threshold (40th percentile) just for a custono would be selected if you are not using the WHERE clause.

    Subqueries are average in the last 30 days and the 40th percentile for 180 days before that. Let's take a look at custno = 5. There were two rows in the last 30 days (225 and 28 amounts), then the average in the last month is (225 + 28) / 2 = 253 / 2 = 126,5.
    Within 180 days prior to that, he had 7 amounts, in ascending order:
    1st (0th percentile): 647
    2nd (17th percentile): 1869
    3rd (33rd percentile): 3065
    4th (50th percentile): 7434
    5th (67th percentile): 8435
    6th (83rd percentile): 9393
    7th (100th percentile): 9712
    Since (for now), we are interested in the 40th percentile. It will be more than number 3065 (33rd percentile) and less than 7434 (50th percentile), 3065 to 7434, somewhat 40% being somewhat closer than 33% to 50%. This number turns out to be 4812.6.

  • How to add space before the content when printing or export PDF

    Hi Experts,
    In OBIEE 11.1.1.6.0.
    It has a single report worth two requests, in order to show the structure of the hierarchy, I add a few spaces in front of the content, however, when I print or PDF exprt, it will be gone. How to solve this problem?

    A single method (maybe it's BUG):
    Inter-generational column-> data-> treat as html Format
    Then in Edit formula, enter the following code: "< table > < tr > < style td =" padding-left: 20 ">" | "Time '." "" By name of half | "" < table > < /tr > < / table > ' "
    When I print or PDF exprt, it will display the HTML to PDF.

    Second method:
    Inter-generational column-> data-> Text Format gross (do not break spaces)
    "Then in Edit formula, enter the following code:" "| Time '. " By name half. "
    When I print or PDF exprt, spaces will be missing in the PDF format.

    I try to make many methods, but can't find the right solution to add spaces before the content of the second report to see the structure of the hierarchy as below:
    CombinedColumn (year and month column combined)
    2009
    -200901
    -200902
    2010
    -201001
    -201002
    Note: '-' in the name of space

    Is there a good suggestion or the method associated with this problem? Please help me to find or give me better advice. Thanks for your kindly help.

    Hey Kobe,

    To achieve this,

    2009
    -200901
    -200902
    2010
    -201001
    -201002

    You can use properties of column-> right = Horizontal alignment and Vertical alignment = at the top, but you have multiple queries in your report. The approach is to differentiate the different levels and apply conditional formatting. Try this approach,

    1. click on the request combined so that you can see the option "Add the result column" in the left pane
    2. click on 'Add a result column', in the type of column in your time dimension column (if the column is first has type saw_0)
    3. yet once, click on 'Add column result', enter the column formula: case when (saw_0) LENGTH > 5 then 2 1 other end

    Here LENGTH (saw_0) > 5 will return only the month records (i.e) 200901,200902 etc.

    4. now click on properties on the column to the new column added in step 2, goto-> add a Condition of-> conditional formatting select the column added to step 3->

    -Case when (saw_0) LENGTH > 5 then 2 1 other end = 2 then format-> right = Horizontal alignment and Vertical alignment = Top

    This indentera the month right column. This will work when exporting to pdf format.

    Kind regards
    DpKa

  • How to calculate an interval between two dates?

    Hi all

    I have two dates, and I need to know if the interval between the two is more than 30 days or not. I can't understand how to calculate this interval.
    Could someone help me?
    Thank you very much.

    See the following forumpost:

    Re: Calculation of difference in date in BPEL

    Kind regards

    Melvin

Maybe you are looking for