Any method to create a total SUM of a column whose values based on LAG?

I have a question here, and the challenge is to explain my situation well. I am developing a workbook that shows by project and month, the cost of this period and the change in the cost of the previous period. I want a total SUM on the columns of this period cost and cost change in prerequisite Mth. So what I want to do resembles something like this--

Months of project cost this time Chg prior Mth cost

ABCDE Jan $50,000 NULL (since no line before)
ABCDE February $ $75,000 25 000
Mar $60,000 ABCDE - 15 000
------------------------ ----------------------------------------------
Total of $ $185,000 10 000

I do the Chg of cost of prior Mth as a new calculation and use the formula insert model process to use the model of the difference f (x) to create my calculation. Who is working just great. If you look at the underlying code for this new section, you can see the LAG function used in the calculation of this value. I'm late to a single line, as you can see in the example above.

I can create a new total and take a NAP in the cost column this time and get the right answer (the $185 000).

The problem that I am running is that I get nothing when I try to summarize my prior Mth column cost Chg. The result is just empty (prints the text of the total, but no amount).

My thought is that the NULL row in this column was to spoil the AMOUNT of work. So, I created a new calculation and said CASES WHERE prior cost Chg of Mth IS NULL THEN 0.00 ELSE cost Chg of Mth prior. So I get a new column with the same numbers, except for the first line, where I now have a 0 instead of NULL. Then, I created a new total (SUM function) on this new column. Heck. Same result with regard to the other column. I do not receive an amount.

Everybody run on an issue to try to sum a column of numbers being calculated from a SHIFT function in discoverer? Any suggestions on how I could get a SUM to calculate correctly to this column cost Chg prior Mth? Or have I met one of those irritating questions "cannot manage in discoverer?

Of course I can export the workbook results run to Excel and create the calculation in there, and that works fine.

John Dickey

Hi John
Thanks for the question and great information. That really helped. I love this kind of questions. They make me think :-)

Just a thought but have you tried to change the AMOUNT for a sum of CELL?

The SUM will try to assess the LAG on the total that would be invalid as, at least in theory, the SUM of the CELL must literally add the values.

Best wishes
Michael

Tags: Business Intelligence

Similar Questions

  • Sum on a column in a collection based report

    Hi all

    I have a sql report based on a collection, it comes to my query

    Select c001, c002, c003 or c004,
    seq_id
    of apex_collections
    where collection_name = "ADDSERVICES."

    Initially, this collection is empty, the user adds the lines in this collection.

    as and when the user adds rows to this collection, I want total (sum) of a column, but its always showing 0.

    How to get the value of the sum?

    Apex4.1
    Oracle 11g R2

    Concerning
    Tauceef

    Tauceef wrote:
    Hi all

    I have a sql report based on a collection, it comes to my query

    Select c001, c002, c003 or c004,
    seq_id
    of apex_collections
    where collection_name = "ADDSERVICES."

    Initially, this collection is empty, the user adds the lines in this collection.

    as and when the user adds rows to this collection, I want total (sum) of a column, but its always showing 0.

    How to get the value of the sum?

    Apex4.1
    Oracle 11g R2

    Concerning
    Tauceef

    Hi Tauceef,

    How do you calculate the sum? means on which column? and finally you calculate the sum in a session of apex? (because apex_collections view is related to the current session of the application)

    I see that your columns (c001, c002, c003 or c004) are only varchar2, if you are sure that it is a number column then it is best to use the number of columns (n001, n002...)

    Thank you

  • Method to create a silhouette of an object without tracing it.

    I have trouble finding a function or a method to create a Bezier path of an object without having to draw a new line.

    I have an existing, established image from a CAD program, in vector.  I would like to make a silhouette of the entire object. Problem is that when 'unit', the whole things turns into one bunch of other small objects because the lines are not joined or joined with something else than to the beginning.

    The result is like this,

    Left is original and the right is when I 'unit '. (I colored to make things easy to see)

    2015-03-12 14-30-55.png

    Any of you have a way to do it without having to find the object manually?

    no promises, but it give a try.

    Make a copy of your object. (blocking or otherwise leave the original unmolested).

    Select the copy. do a live paint Group (object > live paint > make)

    Make sure that there not already fills. If there is, select it, and then set it to no fill. Remove strokes the same way.

    now to add a fill to the entire live paint Group (select it with the black arrow and set a fill color), any color.

    If it seems that you think should be, select the live paint group and click "expand" in the control bar (or object > live paint > expand).

    now use pathfinder > unite.

    I hope that you now have a single path that corresponds to the outline of your original color as you please.

  • Create a shortcut on the desktop the icon comes back to a 'globe' for any shortcut, I create. It does not cover the actual icon as shown in the url or web page. Any ideas?

    Create a shortcut on the desktop the icon comes back to a 'globe' for any shortcut, I create. It does not cover the actual icon as shown in the url or web page. Any ideas?

    Hi Ronnie,.

    I see that you can not create a shortcut on the desktop. I'll help you with this problem.

    1. What is the brand and model of the computer?

    2. what operating system is installed on the computer?

    3. what security software is installed on the computer?

    4. have you made changes on the computer recently?

    5 is the issue limited to the creation of shortcuts on the desktop?

    6. How do you try to create a shortcut on the desktop?

    Please provide us with more information to continue troubleshooting as a result.

    See the link on how to ask questions or help on the Forums.

    Suggestions for a question on help forums: http://support.microsoft.com/kb/555375

    Thank you.

  • I need to print hundreds of pdf files in time of quick of a folder. Could you please suggest any method by which I can print a bunch of pdf files in windows Explorer.

    Hi, I need to print hundreds of pdf files in time of quick of a folder. Could you please suggest any method by which I can print a bunch of pdf files in windows Explorer. Thanks and regards, Madhav

    Then do it in batches of 15

    or

    Several PDF Download printer 1.4.1 - Freeware Files ... .com

    How to print More than a single PDF at the same time . eHow.com

  • Is there any method of rooting without voiding my warranty of U?

    I want to the root of my Xperia without invalidating its warranty is there any method if yes then tell me One.And Simple which is the Bootloader what should I do.

    Any type of modification of the software phones can void the warranty, it depends on the problem. It could also bring additional costs in case your phone needs service if the location of the service need to restore the phone to the original state.

    Wire pass to a proper forum.

  • I want to burn files to a cd, there are two files, one is 8.1 GB and the other is 3.5 GB, what capacity of CD should I buy to take account of these files, or is there any method I can use?

    I want to burn files to a cd, there are two files, one is 8.1 GB and the other is 3.5 GB, what capacity of CD should I buy to take account of these files, or is there any method I can use?

    First of all, you cannot use a CD for each file - they do not provide enough space (and I'm pretty sure same compression help not enough).

    You can burn the 3.5 GB on DVD or DVD-R DVD - RW file, as long as it's a guy with enough space http://en.wikipedia.org/wiki/DVD.

    8.1 GB file CAN be turned into a DVD, but you need a very special type (and maybe special software - I'm not sure about this).  An article on the different types of DVDs and their abilities of here: http://en.wikipedia.org/wiki/DVD.

    There are a few 3rd party software products that allow you to split a large file inot several pieces to fit on a game sequenced CD, but I couldn't find one that was free.  To do this, you can check on www.download.com, www.tucows.com, Bing, and Google.

    I hope this helps.

    Good luck!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

  • Any attempt to create results by "Access denied" error zip file

    Windows 7 Professional 64 bit.  I am logged in as administrator.  UAC is not active on this machine.

    Any attempt to create a zip file results in a dialog box stating "unable to complete the operation.  Access is denied. "
    If I select a file or group of files/folders, do a right click and say 'Send to Zip', I get this error.  Interestingly, while the error dialog box is still open, the zip file will be displayed in the current folder.  Clicking OK in the box dialog error cancels the dialog box and deletes the zip file.
    This seems to be some sort of permissions thing.  Can I create a zipfile by clicking right in the Explorer window by clicking on "new", then "compressed (zipped) folder", and it will create the file very well.  I can even give it a name.  Any attempt to copy anything in this new zip file generates an error "file not found or no read permission.  Try to delete the zip file says 'you need permission from administrators to make changes to this file.
    So now, I open the properties for the zip file and go to the Security tab.  It was there that I discovered that this file has no owner are entrusted to him.  I can then change owners, add my name as the owner of the file, assign full control to myself, apply the changes, and now the zip file can be read/written/removed normally.
    So whenever I need to create a zip file, I have to go through the steps of creating-> change the properties of the-> Assign owner-> Apply-> add files to the Zip file.  It's a royal pain in the keester.
    My question is: what changes to do to confide as the owner by default when a zip file is created?  This seems to happen with only zip files, any other type of file gives me this problem.  What happened since I got this computer brand new with Windows 7 64 - bit on it.  I can't say that it is a "Virgin" installation, he was photographed by a group of COMPUTER companies (I work for a fairly large company).  This group is a clue what happens and apparently others in our society do not report this problem.

    Solved! The problem is with the permissions on the 'TEMP' directory which is used during the process of zip. See this announcement and scroll down to "more useful answer.

  • All of a sudden I can't copy files in Windows Explorer in any method

    Suddenly I can't copy files in Windows Explorer in any method - I get a message from Clipboard "item not added: Format not supported by the Office Clipboard." Never had a problem before, same thing for any type of file, Word or jpg. Am on Windows 7 and Office 7. Have rebooted and done a virus scan, but cannot get this to work.  I can always copy the text from various sources, the problem is only with files.

    Close office word... If you have opened it.

    I personally do not know why you would want to copy instead of cut.

    Unless you like the duplicate files.

    Somewhere the Office clip board interferes with windows clip board,

    Most love because you have Office Open in another window and the clip Panel Office setting is set to always open or at least to check and change these settings.

  • With the help of liquid create a "Total registered" in the basket

    Hello fellow BC users.

    I know using liquid, we are now able to view savings products in small and large product pages, but my question is how we can convert only the shopping cart to create a "Total recorded" is it even possible?

    I tried several pieces of liquid code and even tried to add the value retail Custom1, but of course this is that a 'chain' is so impossible to be treated like a number.

    The website that I am working on http://cctvkits.info, it is a working progress but I would like 1 or 2 items that the customer has added that it would be marked as off sooner rather than later.

    As always help or advice then will be greatly received.

    Thank you

    Hi Tom,

    You will need to use module_data to get additional information for each product in the cart, because you don't have the tags for the retail price in the shopping cart layout.

    1. assign a variable that you will be totalSave.

    2. loop through cart.items and get the retail price for each product

    3. make the difference between that and item.price and multiply by item.quantity.

    4. use of the more filter, add this to totalSave.

    5. output in your page totalSave.

    Let me know if you need more help on this.

    PS You can convert the string customX in a number using the conversion filter

    Stoiky

  • I am creating a total field contingent in a PDF form created by me which will only add cost in total ONLY if the box is checked.  Another disadvantage to this is one of the fields (number of monitors), I am eager to multiply by the field notes.

    I am creating a total field contingent in a PDF form created by me which will only add cost in total ONLY if the box is checked.  Another disadvantage to this is one of the fields (number of monitors), I am eager to multiply by the field notes, which is a field required number on there.

    All of them are select___

    Here are all the names of FQDN (towards the bottom):

    Check the boxes:

    • selectiPhone
    • selectSwipe
    • selectMonitor
    • selectDesktop
    • selectLaptop
    • selectiPadCell
    • selectiPad
    • selectPhone

    Fields of costs:

    • CostiPhone
    • CostSwipe
    • CostMonitor
    • CostDesktop
    • CostLaptop
    • CostiPadCell
    • CostiPad
    • CostPhone

    The notes field that will calculate this is "NotesComputer Monitor in notes". -It is a body of numbers forced the inability to put anything else in it.

    Then add them all in TOTAL COST

    Sorry for my ignorance: it's my first time doing a form like this.

    Please see below for the screenshot.

    2015-10-12_1411.png

    Dropbox - conditionalSum.pdf has the answer

  • In Photoshop CC14, cannot open any file or create a new file.

    I open photoshop (recent and previous update), and it does not allow me to open any files, or create a new. The white screen with tools remains just the same. Other applications such as Illustrator still work. I'm on Windows 8.1. Please help I need Photoshop for my business.

    I can't open or create files. | Error postal codes of Mylenium

    Mylenium

  • Preferred method of creating a relief database creation

    Version: 11 GR 1 material


    Which is the preferred method of creating a database of pending? Is it by

    a. copy the relevant files to the standby server
    b. use of RMAN
    c. use of Data Guard Broker

    Very beautiful :^)

    In order to clarify. You do not use the broker to create the day before. The Broker allows you to manage a wait that you already created. There are no orders in the broker to create a database of pending. If you use Enterprise manager Grid Control, you can use it to create a database of pending which will then automatically (except if you say no) handled by the broker. Take a look at http://www.oracle.com/technology/pub/articles/havewala-easydr.htm for a nice article on how to use the Grid control to create your vigil.

    There are also several documents of MAA on the subject.

    http://www.Oracle.com/technology/deploy/availability/PDF/MAA_WP_10g_RACPrimarySingleInstancePhysicalStandby.PDF
    http://www.Oracle.com/technology/deploy/availability/PDF/MAA_WP_10g_RACPrimaryRACPhysicalStandby.PDF

    to name a couple.

    And of course, there is the Manual:

    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28294/create_ps.htm#i63561
    and
    http://download.Oracle.com/docs/CD/B28359_01/server.111/b28294/rcmbackp.htm#i636377

    But of course (attention, shameless plug book) you should read Chapter 2 of our custody of 11g manual to http://www.amazon.com/Oracle-Data-Guard-Handbook-ebook/dp/B002JA02GG data

    Larry

  • A simple query to write for the SUM of a column

    Hello

    I have a Quantity column. I want his total.
    For a PURCHASE, I would like to add the value in the column Qunatity.
    For a COPY, I want to subtract the value in the column Qunatity.
    So overall, the sum of the column should give me total buy less total sells.

    Any help is welcome.
    Thank you.

    Published by: TechVortex on August 11, 2011 11:49

    Like this?

    SQL> ed
    Wrote file afiedt.buf
    
      1  with sample_data as
      2  (
      3  select 100 quantity, 'B' flag from dual union all
      4  select 200, 'B' from dual union all
      5  select 100, 'S' from dual union all
      6  select 500, 'B' from dual union all
      7  select 200, 'S' from dual
      8  )
      9  SELECT SUM(quantity),
     10         SUM(DECODE(flag, 'B', quantity,
     11                          'S', -quantity)) absolute_sum
     12* FROM   sample_data
    SQL> /
    
    SUM(QUANTITY) ABSOLUTE_SUM
    ------------- ------------
             1100          500
    
  • sum of a column of the dimension

    Hello
    If my requirement of report said we get SUM (Treasury of column) of the dimension table then can we do it? I have undersatnd that function must be used for measures in fact table. What are we doing to reach the sum of the columns in the dimension table? The report tries to compare the sum (column done) sum (dimension columns). Earlier when I used the sum on the column dimension function he gave no precise results. Please advice.

    Unfortunately, I could not explain this matter in a simple unique way, without seeing exactly the report and generated queries

    In the simple table, OBIEE is supposed to do something like this (I assume you put the attribute of the year, money and a measure of 'real')

    "+ select +".
    + Year +.
    + Sum (cash) +.
    + Sum (fact measure) +.

    + Of +.
    + time_dim_table, +.
    + cash_dim_table, +.
    + fact_table +.

    + where (joins).
    + Group by year +.
    "

    You can check if the physical demand looks like this, in order to understand the results.

    In the PivotTable, it's totally different.
    Your physical demand will be no aggregation: so what will:

    "+ select +".
    + Year +.
    + Cash +.
    + Sum (fact measure) +.

    + Of +.
    + time_dim_table, +.
    + cash_dim_table, +.
    + fact_table +.

    + where (joins).
    + Group by year, money +.
    "

    But, OBIEE then apply logic calculatiosn to display goods results in the PivotTable.
    Who can explain the different results.

    But don't forget that told you right: avoid the aggregation on the dimension attributes. You can sometimes has good results (ex: using the pivot, or other), but it's not really the best way to make your reports. If you often need a "sum (cash"), create a new table of logic made with the 'picture of cash' (even if it is also a dimension table).

Maybe you are looking for