Any method to create a SUM Total for a column whose values based on LAG?

I have a question here, and the challenge is to explain my situation well. I am trying to develop a workbook that shows by project and month, the cost this period and the change in cost from the prior period. I want a SUM total on the Cost This Period and Cost Change From Prior Mth columns. So what I want to do looks something like this -
Project Month Cost This Period Cost Chg from Prior Mth
ABCDE Jan $50,000 NULL (since no preceeding row)
ABCDE Feb $75,000 $25,000
ABCDE Mar $60,000 -15,000
Total $185,000 $10,000
I do the Cost Chg from Prior Mth as a new calculation, and use the Insert Formula from Template process to use the F(x) Difference template to create my calculation. That is working just great. If you look at the underlying code for this new column, you can see the LAG function being utilized in calculating this value. I am lagging one row, as you can see from the example above.
I can create a new total and do a SUM for the Cost This Period column and get the correct answer (the $185,000).
The problem I am running into is that I am not getting anything when I try to sum my Cost Chg from Prior Mth column. The result is just blank (does print the total's text, but no amount).
My thought is that the NULL row in this column was messing up the SUM from working. So I created a new calculation and said CASE WHEN Cost Chg from Prior Mth IS NULL THEN 0.00 ELSE Cost Chg from Prior Mth. So I get a new column with the same numbers except for the first row, where I now have a 0 instead of NULL. I then created a new total (SUM function) on this brand new column. Darn. Same result as for the other column. I do not get an amount.
Has anyone else run into an issue with trying to sum up a column of numbers that are being calculated from a LAG function in Discoverer? Any suggestions on how I could get a SUM to properly calculate for this Cost Chg from Prior Mth column? Or have I run across one of those irritating "cannot handle in Discoverer" issues?
Of course I can export the workbook run results to Excel and create the calculation in there, and that works just fine.
John Dickey

Hi John
Thanks for the question and the great information. That really helped. I love these kinds of questions. They make me think :-)
Just a thought but have you tried altering the SUM to be a CELL SUM?
The SUM will try to evaluate the LAG over the total which would be invalid whereas, at least in theory, the CELL SUM should literally add the values.
Best wishes
Michael

Similar Messages

  • Is there any way to create admin role only for one resource.

    Hi all,
    I am trying to create an admin role with 'update user' capability. But I want to restrict the user(with the admin role) to be able to update a user's attribute only for one resource, The user(with the admin role) should not be able to update the attributes of the other resources which a user have.
    Is there any way to create admin role only for one resource?
    I customized the tabbed user form to show only one resource attribute (deleting the missing fields and adding my tab for the resource) and then assigned this new User Form to the user(with the admin role) in security tab.
    It works fine. But the problem is that if any user(with the admin role) is also admin of some other resource then he/she will not be able to view the other resource attributes.
    Please suggest,
    thanks

    The loop function always repeats the same region so of course the fade is also copied. So option+drag the original region to make a (non clone) copy, fade the first region and loop the second one (which you just copied).

  • Any way to create a keyboard shortcut for keywords in Bridge CC?

    Just curious if there's any way to create a keyboard shortcut for "new keyword" and "new sub keyword" in Bridge CC?
    If not, that would be a welcome addition in any future Bridge update - being able to customize keyboard shortcuts or add your own the way you can in Premiere Pro CC.

    Steve,
    Not, as far as I know, directly, but the problem is with Aperture, not Keyboard Maestro.  Aperture has no command (afaik) for selecting the caption field of the Info Inspector.  Without a command, you will have to find another way to access it, or another way to accomplish what you want.
    You can specify the spot clicked by screen coordinates, so you cold use the Inspector HUD and the coordinates of the Caption field, as long as the Inspector HUD always pops up in the same location.
    Many dialog boxes allow the user to advance through the fields with the Tab key.  Unfortunately, the number of times you have to type "{Tab}" in order to get to a particular field depends on other interface elements (if the Control Bar is showing, add 2).  I don't know of a way to determine if the Control Bar is showing.
    You might find a work-around using a Metadata Preset and the Batch Change command.  Keyboard Maestro can easily pop up a dialog with a text field in which you can type what you want to go into Aperture's Caption field.
    The best thing to do is download the trial version and see if it meets your needs.  Keyboard Maestro is adept at creating macros based on keyboard input.  If the program does not provide keyboard equivalents, writing an effective macro becomes difficult.
    http://www.keyboardmaestro.com/main/
    The author provides exemplary documentation:
    http://wiki.keyboardmaestro.com/About_Keyboard_Maestro
    Lastly, for the use you cite, I simply show the Inspector if it's not showing (by typing "i"), change to the Info tab if it is not currently activated (by clicking, but note that opening the Inspector with the Info tab selected can be done with one command "View➞Inspector➞Info"), and then clicking in the Caption field, which is part of all of the Metadata Views I regularly use.
    HTH.  Perhaps one of our programming mavens will suggest something better.
    --Kirby.

  • Is there any plan to create a HTML5 shell for flash player apps & interactive elements?

    Is there any plan to create a HTML5 shell for flash player apps and elements? The canvas option is very limited and many apps & old, interactive flash elements no longer work on most mobile devices. 

    HTML5 is the "anti-flash", so to speak. It requires no plug-ins. HTML5 is MP4 which is QuickTime video. That's the "shell" for it.
    Steve Jobs said in 2006, when iOS was first released, that "playing Flash content is processor consumptive and drains batteries in mobile devices, reducing their life." That's why Apple iOS devices have never been compatible with Flash, and also why Android dropped support for the technology in June of 2012.
    Android has "Dolphin" and "Puffin" browsers, which render Flash content (video and animations) "server side" to reduce the load on mobile devices running Android. Likewise, Apple has "SkyFire" which works the same way, but is designed specifically for iOS.

  • Exist any API to Create a new Costing for employee?

    I want to add new Costing for employees using API's ,
    Exist any API to Create a new Costing for employee?

    Hi
    there are no public APi's to create the costing in Oracle,
    u can use CST snapshot interfaces and run the standard import costs concurrent program

  • Page Total for a Column in JSF HtmlDataTable

    Hi All,
    I need an example to calculate page total for price column in HtmlDataTable.
    Each page displays 10 rows and there are 50 rows hence 5 pages in datatable.How to calculate page total after displaying the rows on page.
    Thanks in advance.

    Just get the desired sublist of the datalist and sum the price? You can get the starting index and the rowcount from the HtmlDataTable by its getFirst() and getRows() methods respectively and use it in List#subList(). Then iterate over the list and add the price value of every item in a loop to the total value. You can display it in the footer of the datatable. You can define a footer with <f:facet name="footer">.

  • Calculating Totals for a column in ALV Grid Display

    Hi All,
      I frustrated with the problem of simple calculating total for a column. I wrote the following code:
      LW_CATALOG-TABNAME   = P_GV_STRUCT.
      LW_CATALOG-FIELDNAME = 'ZSUMMS'.
      LW_CATALOG-DO_SUM    = GC_X.
      APPEND LW_CATALOG TO G_FIELDCAT_TAB.
      CLEAR LW_CATALOG.
    It is not working. Could you please suggest the solution?
    It would be great help to me.
    Advanced Thanks,
    Phani Kumar

    Phani,
    Did u try playing around with any of these layout fields ?
    no_sumchoice(1),       " no choice for summing up
    no_totalline(1),       " no total line
    no_subchoice(1),       " no choice for subtotals
    no_subtotals(1),       " no subtotals possible
    no_unit_splitting  " no sep. tot.lines by inh.units
    totals_before_items,   " diplay totals before the items
    totals_only(1),        " show only totals
    totals_text(60) ,      " text for 1st col. in total line
    subtotals_text(60) ,    " text for 1st col. in subtotals
    b. Addtionally... not a solution.. but u know...
    just try the same code iwth reuse_alv_list_display and see if the total gets displayed properly ?

  • Is there any possibilites to create different control centers for one Owner

    Dear All,
    We are using OWB10g version 10.2.0.1 and we are having database and owb is in same server.we have total 5 users for that we can access this servers. Now my question is
    Is there any possibilities to create two or three control center for one Design center(owner) with different names and how can give privileges to only run the mappings for that control center.
    This is urgent please give suggest me.
    Thanks in advance.

    Thank you Oleg,
    Please see my requirement below in detail.
    1)We have only one database and server, we are using that server is per Supporting and Development.
    2)We don't have separate databases for the supporting and Development.
    3)We are using only one control center to run the mappings for supporting and Development( if we have any new requirement and changes the Existing mappings).
    So Every body(supporting and development) having privileges to do any changes.so we are facing some sort of problems here.
    So we need to give privileges(only run the mappings not to do changes in mapping) some persons.
    Some persons have only permission to develop new mappings only(they don't have access to existing mappings).
    Per supporting people have only permission to run the mappings and do not touch even staging database also.
    This is my requirement, please give your suggestion how to do this because we don't have the Administrator to do all these things.
    Thanks in Advance,

  • Is there any way to create a wifi hotspot for my macbook using my IPad?, Is there any way to create a wifi hotspot for my macbook using my IPad?

    I am going to a lake cabin in Northern Minnesota for a week and need to get wifi for my Mac.  Is there any way to create a wifi hotspot using my Ipad so that I have internet service for my laptop?

    No, iPad can become a hot spot, but if you have an iPhone, it can tether if you have a data plan that incudes the tethering option.  With AT&T for example, you can add tethering for $20 month or for $45/month, you receive tethering and 4GB of data per month.  If you have the unlimited data plan from AT&T you'll unfortunately have to give it up if you want to tether.  You can also go to almost any carrier and purchase a MiFi unit which may work for you.  Whether iw will work in Northern Minnesota is something only your carrier could answer.

  • How to display total for a column in updateble report

    How can I display total on a report column?
    the query is
    select htmldb_item.checkbox(1,invoice_id) invoice_id,
    htmldb_item.DISPLAY_AND_SAVE(2,invoice_no,15)invoice_no,
    htmldb_item.DISPLAY_AND_SAVE(3,to_char(invoice_date, 'DD-MON-YYYY'),20) invoice_date,
    htmldb_item.DISPLAY_AND_SAVE(4,net_amount,15) NET_AMOUNT,
    htmldb_item.text(5,net_amount,null,10) amount_adj,
    htmldb_item.text(6,net_amount,null,10) actual_amt
    from INVOICE
    where OWNER_TYPE = 'CUSTOMER'
    and OWNER_ID = :P57_CUSTOMER_NAME
    group by invoice_id,invoice_no, invoice_date,net_amount
    In the report column attributes the sum column is checked for the sal field
    When I run the report, I get a Sub-total of 0 and a Report Total of 0. What am I doing wrong?
    thanks

    Sunil,
    Which column is the sal column? I can’t see any numeric columns in your query. If you use htmldb_item calls in your query column, then this makes them strings and you can’t build sums on string columns. If you want to build sums in an updateable report / tabular form, then don’t use the htmldb_item API. Instead use the built-in display types on the report column attributes page. Using the built-in display types is the better options in most cases anyway and they do allow you to calculate sums even if the column is a text field or display and save type field.
    Regards,
    Marc

  • SUM function for a column made 'on the fly'

    I have access to a database, however only SELECT statements can be run on the database. Basically the database lists switches, these switches can have up to 20 computers connected to them but some do not. I need to know the switches which contail less than 20 computers so I know where there is space for more computers (I've wrote the code for this already). I also need something to keep a tally/total for the number of spare spaces left so I can run the script and go 'ok we have a total of 20 spare places for computers theres 10 on this switch and 10 on this one'.
    I just need to get the sum funtion working for the column that I've created 'on the fly', the column revealing the number of spare slots, heres the code I've got so far:
    SELECT switch, COUNT(*) as "Servers", 20 - COUNT(*) as "Spare slots"
    from dedicated_servers
    where switch like 'rs%'
    GROUP by switch
    HAVING COUNT(switch) < 20
    order by Servers;
    Which gives the following:
    | switch | Servers | Spare slots |
    | rsj14-1.dc | 12 | 8 |
    | rsj12-1.dc | 15 | 5 |
    | rsi2-2.dc | 16 | 4 |
    | rsj13-1.dc | 16 | 4 |
    | rsi2-1.dc | 16 | 4 |
    Just need something at the end saying TOTAL=25

    OK I'll have to make em up though, but they are something like this for one switch:
    INSERT INTO dedicated_servers (switch, server_number, switch_socket)
    VALUES (rsj-1.dc, 100, 18)
    On switch rsj-1.dc there can be upto 20 servers (the server_number is the primary key)
    Message was edited by:
    slowpoke115

  • Grand Totals for GOURL columns

    We are having an issue showing Grand Totals for GOURL enabled columns
    We have enabled GOURL on the amount columns, To enable hyperlink we had to convert the the number column to character. Enabling the Grand total in the Table View is thorwing error "Function Report_Sum does not support non-numeric types".
    Any input on the above would be of great help.
    We are using OBIEE version 10.1.3.4
    Thanks
    Kranthi

    You can try the following..
    1) Keep the same name for all the amount fields in each column. (for example, first amount column field name is "Amount1" and second column field name is "Amount2").
    2) Then write the code in the Calculate event of the Total field. (Use FormCalc)
         Total1.rawValue = Sum(Table1.Row1[*].Amount1);
    3) Similarly for Second column
         Total2.rawValue = Sum(Table1.Row1[*].Amount2);
    4) For the total of Amount1 and Amount2.
         LoanTotal = Sum(Total1.rawValue + Total2.rawValue);
    Hope this helps.
    Thanks
    Srini

  • Can an individual create a voice memo for free on their Windows based laptop via Apple website and then send it to perhaps an iCloud client?

    I am hard of hearing and will likely become deaf one day, so for me receiving voice memos (not telephone voice messages) on my iPhone is a nice treat!  Unfortunately not everybody has an Apple device.  Some of my family members and friends have tried to create a voice memo via Windows Media Player and sent it to my email, but as most know... I can't play the voice memos on my iPhone even after trying to use a conversion program to convert the voice memo. 
    So my question is... Can any individual (regardless of device they use) create a voice memo for free on the Apple website and sent it to an Apple client?
    i absolutely love my iPhone.  The accessibility options are wonderful to have for people who are deaf or hard of hearing.  But having this one accommodation done for the hard of hearing people specifically
    Thank you!
    Angèle

    cfr wrote:
    @lahwaacz,
    Could you point me to documentation regarding bugs/problems with laptop-mode tools? I'm using that right now and it has always worked pretty well but I'm currently seeing higher temperatures (~10C higher on average) and trying to figure out why.
    My fan operates continually but not, I think, very aggressively. But it has always done that so I assume it is normal for this laptop. (Have no idea really but it doesn't seem out of the way - it is a laptop, after all...)
    I don't know anything about fan control, my laptop controls fan speed automatically, I can't even get current fan speed.
    The main problem with laptop-mode-tools is that it's very huge, and the bigger the program is, the slower is the execution. Another problem is that it's connected to both battery and AC adapter ACPI events (see /etc/acpi/events/lm_{ac_adapter,battery}). On my laptop, those events are sent at the same time, resulting in running laptop-mode-tools twice. Most people once configure laptop-mode-tools to their liking and their hardware, so I think there is no need for such an extensive software like laptop-mode-tools, if something simpler does the same (or better) job.
    Also laptop-mode-tools can conflict with pm-utils (which are installed on many systems as dependency for some packages):
    https://wiki.archlinux.org/index.php/La … able_on_AC
    https://bbs.archlinux.org/viewtopic.php?id=106989

  • Removing Totals for Break Columns

    Hi All,
    If we add break on two or three columns in report, it gives totals for each group plus a report level total. Is there any way to remove any group or break's total.
    For example, if we have a report on emp table and having groups on deptno and job columns, it would be giving totals like this:
    JOB TOTAL:               3000
    DEPTNO TOTAL:               3000
    report total:               3000
    How can we remove any of the above totals?
    Thanks
    Zahid Khan
    Deptno

    Looks like this is a popular request!
    I have report with a break on Column 1, 2 and 3. I would like to display the Report totla but not the sub totals at each column break. Can anyone please share their experience on how to get rid of the Sub Total for a break column?
    Thanks.

  • Creating an SQL Query for Project Custom Fields Values

    Hello:
    I'm currently trying to create an SQL Query to show all of the server's Project Custom Fields Values, along with the modification date.
    So far, I've managed to display correctly all of the data for all of the Projects' text value Custom Fields (those not based on a LookUp Table) with this query:
    SELECT
    MSP_PROJECTS.PROJ_NAME,
    MSP_CUSTOM_FIELDS.MD_PROP_NAME,
    MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE,
    MSP_PROJ_CUSTOM_FIELD_VALUES.TEXT_VALUE,
    MSP_PROJ_CUSTOM_FIELD_VALUES.MOD_DATE
    FROM
    MSP_PROJ_CUSTOM_FIELD_VALUES
    INNER JOIN
    MSP_CUSTOM_FIELDS
    ON MSP_CUSTOM_FIELDS.MD_PROP_UID = MSP_PROJ_CUSTOM_FIELD_VALUES.MD_PROP_UID
    INNER JOIN
    MSP_PROJECTS
    ON MSP_PROJECTS.PROJ_UID = MSP_PROJ_CUSTOM_FIELD_VALUES.PROJ_UID
    WHERE
    MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE IS NULL
    ORDER BY
    MSP_PROJ_CUSTOM_FIELD_VALUES.PROJ_UID,
    MSP_PROJ_CUSTOM_FIELD_VALUES.MD_PROP_UID
    However, when I try a new Query to obtain the actual values for the Projects Custom Fields that do use a LookUp Table, I can't seem to find what table in the model I'm supposed to link to the MSP_PROJ_CUSTOM_FIELD_VALUES.CODE_VALUE field (the TEXT_VALUE
    field has NULL value when CODE_VALUE field isn't NULL)
    Any suggestions on how to obtain the actual Projects' custom fields values instead of the Code Value, for Metadata that do use a LookUp Table?
    Also, I'm able to run this query only in the Published Database, since the MSP_CUSTOM_FIELDS table is empy in the Draft Database. Why is that?
    Awaiting your kind reply,
    Sebastián Armas PMO Project Manager

    Hi Sebastián, rather than directly accessing the database it would be better to use the PSI to get this data.  Take a look at the ProjTool sample in the SDK whcih gets this data.
    Best regards,
    Brian.
    Blog |
    Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
    Project Server TechCenter |
    Project Developer Center |
    Project Server Help | Project Product Page

Maybe you are looking for

  • Writing a large amount of data out.

    I am working on a large simulation application. The simulation keeps track of up to 1000 nodes. The simulation is designed to simulate about 20 properties per node every 5 minutes over the course of a year. So for every 5 minutes for that year (about

  • New iMac and Final Cut Pro Error

    Just got a new 20" iMac. It comes with a ATI Radeon XT graphics card. I used Migration to transfer all apps and files from my old 17" iMac G4. When I launch Final Cut on the new iMac I get the following configuration error message: This software requ

  • Masking sensitive data in the messages?

    All, We are getting some sensitive data from a legacy system that needs to be imported into R/3. There is a translation service - that translates the sensitive data into public format. The question i have is - though we will be able to use XI to call

  • Photoshop CS4 did not install???

    I just installed CS4 on my MAC. everything went fine and I got no error messages. but when I look into my applications I see that Photoshop isn't there! the others are all there. Is this because I had the PS4 trail version? I had totally removed it f

  • Playlists with iPod touch

    Hi, I have a 1st gen iPod touch and an iPhone 3G. When I got my iPhone (Pay and Go), iTunes asked me if I wanted to configure it in the same way as my touch. I said no, but opted to sync my Purchased on +iPod touch name+ playlist to keep all my iTune