Implementing the Last Non Empty

Dear All,
I am trying to get the last non empty set by applying the Last Non Empty property to the measures Projectedvalue and Gross amount.  The below is the original table.
The output I want is as below:
For the Revised Quarter type Original all the recent values of the Projected quarter should be displayed.
As you can see the last value for Q1 needs to be selected which is shown in above pic.
Currently the cube output is same as the original table. :(
Can anybody help me on this?
Thanks, Franco.

Hi Franco,
In SQL Server Analysis Services (SSAS), LastNonEmpty is an aggregation function available in the Enterprise version of SQL Server. Essentially, you simply create a calculated member that returns the non empty value, or if empty, it looks in the previous
member. Please take a look at the articles regarding Last Ever Non Empty.
Getting the last non empty value
The Last Non Empty Dilemma
Last Ever Non Empty – a new, fast MDX approach
Regards,
Charlie Liao
TechNet Community Support

Similar Messages

  • DAX: Last Non Empty per date (Most Current Inventory)

    Here is a little context.  I have product subcategory as row label.  I have a daily snapshot of inventory and using count of inventory as the measure.  The measure I want to be sure that I return the latest dated inventory when I don't specify
    a date as the column label.  But if a date is specified then I want to be sure to show that dates inventory in which the cell relates.  Inventory from day to day can go to 0.  So not everyday a subcategory has inventory. I have tried using LastNonEmpty
    to return the last date.  But what happens is one subcategory is from today and the next subcategory is from the previous day that did have inventory for that date.  I have been able to create a measure that returns the max date for which the column
    pertains.  Here is that formula.  CALCULATE(MAX([Business Date]), ALLEXCEPT('Inventory', 'Date')) 
    What I cannot seem to figure out is how to put that into the filter context for the inventory count so I return inventory which only pertains to that date.  Any and all help is appreciated!

    If every subcategory can have a different date, you should use this technique:
    Inventory :=
    SUMX (
        VALUES ( Product[Subcategory] ),
        CALCULATE (
            SUM ( Inventory[Quantity] ),
            LASTNONBLANK (
                'Date'[Date],
                CALCULATE ( COUNTROWS ( Inventory ) )
    You might also use this approach (but I prefer the former because it is potentially faster in the LASTNONBLANK iteration):
    InventoryInternal := SUM ( Inventory[Quantity] )
    Inventory :=
    SUMX (
        VALUES ( Product[Subcategory] ),
        CALCULATE (
            [InventoryInternal],
            LASTNONBLANK (
                'Date'[Date],
                [InventoryInternal]
    Marco Russo http://ssasworkshop.com http://www.sqlbi.com http://sqlblog.com/blogs/marco_russo

  • Changing Preferred Language leaves Mail.app's FLAGS menu showing the last non-English language

    After changing the System's Preferred Language to FRANCAIS, then back again to BRITISH ENGLISH, I've found that the FLAGS menu of MAIL.APP will not change back to ENGLISH.
    e.g.
    - I change the Preferred Language setting to FRANCAIS,
    - I restart Mail.app.
    - I change the Preferred Language setting to BRITISH ENGLISH
    - I restart Mail.app.
    The Flags menu is still in FRANCAIS. Every other menu is using the correct language
    - I then change the Preferred Language to ESPANOL
    - I restart Mail.app
    - I change the Preferred Language setting to BRITISH ENGLISH
    The Flags Menu is now in ESPANOL.
    It seems I can change the FLAGS menu to anything other than ENGLISH or BRITISH ENGLISH.
    Rebooting between changes and/or leaving Mail.app open or closed seems to make no difference.
    It's quite annoying as I make extensive use of keyboard shortcuts to flag emails....!
    Any clues?

    I should point out that every other menu is changing correctly to reflect the Preferred Language. It is just the FLAGS menu that is not changing to english.

  • I need to know if the last non beta version of firefox supports the google toolbar. I will only update firefox if that is the case!

    one month or two ago i was in NY at a friends house, and he updated firefox and in the new version what happened? "kaput" GOOGLE TOOLBAR GONE.
    There are features in GT that firefox does't provide. I won't live without GT. Therefore i will only update firefox when sooner or later, will come to know that the new version doesn't "kill" GT.

    Google decided that they will no longer produce the Google Toolbar for Firefox beyond Firefox 4. Future versions of Google toolbar will only work with IE7-9. Google Toolbar is not available on any other browser, even Google's own browser.
    *http://googletoolbarhelp.blogspot.com/2011/07/update-on-google-toolbar-for-firefox.html
    *http://www.google.com/support/toolbar/bin/answer.py?answer=1342452&topic=15356%29
    *Google Toolbar 8 FAQ (IE only): https://www.google.com/support/toolbar/bin/answer.py?hl=en&answer=1111588
    Alternatives:
    *http://kb.mozillazine.org/Using_Google_Toolbar_features_without_toolbars
    *https://addons.mozilla.org/en-US/firefox/addon/googlebar-lite/
    *https://addons.mozilla.org/en-US/firefox/addon/gbookmarks-google-bookmarks-fo/
    '''If this reply solves your problem, please click "Solved It" next to this reply when <u>signed-in</u> to the forum.'''
    Not related to your question, but...
    You need to update some plug-ins:
    *Plug-in check: https://www-trunk.stage.mozilla.com/en-US/plugincheck/
    *Shockwave Flash (Adobe Flash or Flash): [https://support.mozilla.com/en-US/kb/Managing%20the%20Flash%20plugin#w_updating-flash Updating Flash in Firefox]

  • Plot empty point in line chart with previous non empty value

    Hello,
    I have a problem to plot series data in SSRS line chart, with the empty point, I don't want use average and zero provided by the report builder, I want use the last non empty data to fill the empty point, tried to use expression =Previous(Field!Value), no
    luck, any one have some good idea?
    P.S. do not want to use query to fill the null with previous non null value, just from the performance point view. at last , the chart should have some line as square wave with different height, if I use average for empty point, it shows slop wave line which
    is not reflect the real production.
    Thanks
    Richard 

    Hi Richard,
    In Reporting Services, if the chart type is a linear chart type (bar, column, scatter, line, area, range), null values are shown on the chart as empty spaces or gaps between data points in a series. By default, empty points are calculated by taking the average
    of the previous and next data points that are not null.
    If we want to use previous value to replace the empty value, please refer to the following steps:
    Right-click the field which displayed in Y axis (Height) to open the Series Properties.
    In the Value field to modify the expression to look like this:
    =iif(isnothing(Sum(Fields!Height.Value)),previous(sum(Fields!Height.Value)),sum(Fields!Height.Value))
    The following screenshot is for your reference:
    If there are any other questions, please feel free to ask.
    Thanks,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • Previous non empty value

    Hi,
    I have a situation where I have to update the previous non empty date until there is non empty value. Then use the next non empty value. Data is sorted on group id.
    for example I am creating new field which update the date column which just for example:
    it would be great if there is way to implement using set operation not through cursor.
    thanks in advance
    Zaim Raza
    http://zaimraza.wordpress.com/

    CREATE TABLE #C (X CHAR(1) ,Y INT)
    INSERT INTO #C values(NULL, 1)
    INSERT INTO #C values(NULL, 2)
    INSERT INTO #C values(NULL, 3)
    INSERT INTO #C values('A', 4)
    INSERT INTO #C values(NULL, 1)
    INSERT INTO #C values(NULL, 2)
    INSERT INTO #C values('B', 3)
    SELECT * FROM #C
    ALTER TABLE #C ADD ID INT IDENTITY(1,1)
    SELECT CASE WHEN X is not null
                THEN X
                ELSE (SELECT MIN(X)
                      FROM #C
                      WHERE ID >= t.ID)
           END AS X,
           Y
    FROM #C t
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • OBIEE: non empty cross join function problem with some reports

    Hi all,
    I am getting some problem ,when we are excuting some requests in OBIEE its taking long time , Actually our OBIEE is connected with Essbase when we are generating some reports its taking long time so i captured the Query in OBIEE and Iam excuting that query in Essbase MDX editor
    its having the the function " NON EMPTy CROSS JOIN"
    which reports having non empty crossjoin function its taking long time so how can i disable this function in OBIEEfor that reports
    I dont want to use that function for my reports so how can i do this in OBIEE
    your help would be appriciated.
    Thanks
    Edited by: user8815661 on 26 mai 2010 08:44

    Any Help

  • Phantom Object on a last non-GC DC?

    Hi,
    I'm wondering what happens to the phantom object on the last non-GC domain controller in the domain/forest once it becomes a GC? Are they get destroyed immediately or they will stay hanging around in the database forever? Should I transfer Infrastructure
    Master to that DC before making it a GC to cleanup those?
    Thanks,
    Ivan
    Ivan Seriavin

    Well it depends right?  So if the objects are not stale an exist in the trusted forest then they wouldn't get delete because well, they're not stale right?
    So the question would be:
    If there is a phantom object pulled over from a trusted forest to a non-GC is there enough information or is AD aware enough that if a non-GC, that has a phantom object, is then converted into a GC, does AD delete the phantom object or merges the data in
    some way.
    I'm saying I doubt it and the phantom object stays even after a non-GC is switched to a GC even if IM is on a non-GC because the object wouldn't be stale and (I don't think) would get caught with garbage collection. 
    Either way that's a pretty awesome question and I may take some time over the weekend to play with that.
    If it answered your question, remember to “Mark as Answer”.
    If you found this post helpful, please “Vote as Helpful”.
    Postings are provided “AS IS” with no warranties, and confers no rights.
    Active Directory: Ultimate Reading Collection

  • I am trying to restore ipad from previous back up. it requests a password it is none of the passwords I have used in the last decade any ideas to get around this?

    I am trying to restore my ipad from previous back up. itunes requests a password, it is none of the passwords I have used in the last decade any ideas to get around this?

    The password would be either your iTunes ID password or your admin password for the Computer.
    MJ

  • My daughter accidentally restored her ipod4 to factory settings so I restored from the last iCloud backup. Her photos were all on camera roll so I believe should have been backed up, but none of them have been restored. Why?

    My daughter accidentally reset her ipod4 to factory settings so I restored from the last iCloud backup. All her photos were on camera roll so I believe they should have automatically been backed up, but none have been restored. Why?

    When she plugged in the ipod last night it backed up again so that now shows as the latest backup. No previous backups are listed so I do not seem to have the option to rerun the old one. She had many pictures on the camera roll taken from well before July. I can only presume that the backup in July must have been incomplete - but then I didn't think it was supposed to list as an option to restore from. Luckily many of the photos had been backed up on the pc but I am very frustrated as to why the icloud backup didn't protect them. Thank you for your advice though, I appreciate it.

  • Last Friday, the broken glass of my iphon g3 replaced. Since then, remains the screen of my iphon regular black. The battery is not empty. By the restart I get my iphon back to life. It always comes back sooner. The last 24 hours 3x. Is there a solution?

    Last Friday, the broken glass of my phone g3 replaced. Since then, remains the screen of my iphon regular black. The battery is not empty. By the restart I get my phone back to life. It always comes back sooner. The last 24 hours 3x. Is there a solution?

    Since Apple doesn't repair iPhones (they replace them) you will have to take it back to whoever "fixed" it. Since it's been opened by an unauthorized 3rd party, it is no longer eligible for replacement by Apple.

  • Can the last link in a thunderbolt daisy-chain be a non-thunderbolt monitor using miniDisplay port?

    Can the last link in a thunderbolt daisy-chain be a non-thunderbolt monitor, using miniDisplay port?
    For example, Mac mini <--> external SSD <--> apple cinema display 30" (using miniDisplay port adaptor plugged into the SSD's second thunderbolt port)

    TechnoMax wrote:
    for instance STAE122 or STAE 127?
    FWIW, STAE129 is the current version TB adapter
    that is self powered and has TB daisy chain port.
    STAE122 and STAE127 are older versions and
    not the current model, though there may be stock of
    these around.  As to whether this will solve your issue,
    I don't know.
    Can I trick the Mac under Bootcamp as OS to use HDMI for the monitor? Dell officially says that the monitor can only accept 1900x1080 over HDMI, but some have fiddled wth different computers with custom settings that worked with some Monitors but mostly under Linux and to Dell 2711.
    The MacMini HDMI port is hardware limited to 1980x1200.

  • I have iphoto 08 version 7.1.5.  I copied photos from recent - last import into albums.  I then deleted the photos and emptied the trash. Today all the albums are empty and the photos are nowhere in the library.  Have I lost them all?

    I have iphoto 08 version 7.1.5.  I copied photos from recent - last import into albums.  I then deleted the photos and emptied the trash. Today all the albums are empty and the photos are nowhere in the library.  Have I lost them all?

    OK, here are a set of screenshots with my step by step - maybe you will be able to spot where I've gone awry:
    I find a photo in the Library that I will delete from an album:
    I go down to my Albums and find the picture in one of them:
    I hover over the pic so the little down arrow appears in the bottom right-hand corner. I click on it, then click on the Trash Can in the window that drops down:
    Gone from the Album:
    Gone from the Library:
    In the Trash:
    Whaddup with that?
    GB

  • I have been using the apple IPad camera connection kit and my photos can be viewed in the events... But the all imported folder is no longer there and the last import folder is empty. Is there any way to resolve this ang get my all imported folder back?

    I have been using the apple IPad camera connection kit and my photos can be viewed in the events... But the all imported folder is no longer there and the last import folder is empty. Is there any way to resolve this and get my all imported folder back? as well as get my last import functioning normally?

    Please please help me, if you know how.

  • Mdx : Sum up the measure from start but need only non empty rows

    Hi All
    i have created a calculated measure where it suming up all its previous avaialable values based on Date dimension.
    Everything is working but we are getting all rows from that datetimension . how can get only till current date,
    SUM(NULL:[Date].[Hierarchy].currentmember,[Measures].[SIMID])
    Surendra Thota

    Hi Surendra,
    According to your description, you want to calculate the sum up the measure from start for those non empty rows, right?
    In this case, please try the query below.
    WITH MEMBER [Measures].[Sum from start]
    AS
    SUM ({NULL:[Date].[Calendar].CurrentMember},
    [Measures].[Internet Sales Amount])
    SELECT {[Measures].[Internet Sales Amount],[Measures].[Sum from start]} ON 0 ,
    nonempty([Date].[Calendar].[Calendar Year].MEMBERS) ON 1
    FROM [Adventure Works]
    Result
    Besides, here is a blog which describe various way to calculate running total, please see:
    http://blog.sqltechie.com/2011/01/various-way-to-calculate-running-total.html
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

Maybe you are looking for