Lag function not working in calculated measure

I am facing a strange problem while using "Lag" function in calculated measure.
I have a time dimension which consists of date, workday, financial week, Financial Month and Financial Year.
The concept of workday is its a integer number which represents date. In case of holidays this number donot change and remain constatnt till next working day. 
Here workday no remains 460 as 20120708 is a holiday.27 and 28 denotes FinancialWeek.
Now basically I want to find previous wokdays count.
with member [Measures].[Prev Count]
AS
sum(
          existing [Date].[Workdayno].[Workdayno].Members,
 ([Date].[Workdayno].lag(1),[Measures].[Fact Count]))
Select { [Measures].[Prev Count]} on 0,
{[Date].[Calendar].Members} on 1 from [My Cube]
Where([Date].[Calendar].&[20120709])
What I expect that It will give me sum of counts where wokday no is 460.
But its showing null value.
with member [Measures].[PrevCount]
As
SUM(EXISTING [Processing Date].[Workday].[Workday].MEMBERS,([Processing Date].[Workday].LAG(1),[Measures].[Sequenced Records]))
SELECT {[Measures].[PrevCount]} ON 0 FROM --[E2Eitem]
WHERE([Processing Date].[E2E Calendar].[Date].&[20120709])
It looks like existing function is failing to exist the member related to date??
Any suggestion.

Try using
with member [Measures].[Prev Count]
AS
sum(
          existing [Date].[Workdayno].[Workdayno].Members,
 ([Date].[Workdayno].currentmember.lag(1),[Measures].[Fact Count]))
Victor Rocca

Similar Messages

  • MDX -Children count function Not working in Case statement

    Hi,
    I am trying to create set when you slice with the Hierarchy member is leaf level , I want a output only that Leaf level .
    and When I slice with  the parent level , it has to give all the members below that parent level.
    But the problem here is when I select child member or leaf member , The first condition in the Case is not working
    WITH SET
    TESTSET AS
    CASE
    WHEN
     [Dimension].[Hierarchy].currentmember.children.count<0
    THEN
     [Dimension].[Hierarchy].currentmember
    ELSE
     DESCENDANTS([Dimension].[Hierarchy].Currentmember,,AFTER)
    END
    SELECT
    WBSSET ON 1,
    {} on 0
    FROM
     (SELECT {[Dimension].[Hierarchy].&[10]} ON COLUMNS FROM [CubeName])
    Thanks,
    Santosh

    Hi Santosh,
    I don't think Children count function not working in case statement, I have tested it on my local environment, here s the sample query for you reference.
    with member
    testset as
    case
    when
    [Geography].[Geography].currentmember.children.count<10
    then "X"
    else "OK"
    end
    select testset on 0,
    {[Geography].[Geography].[Country].members} on 1
    from
    [Adventure Works]
    In your scenario, the issue might be caused by the query isself, you can try to use IsLeaf Funcion to achieve your requirement. Please refer to the links below.
    http://msdn.microsoft.com/en-us/library/ms144932.aspx
    http://www.databasejournal.com/features/mssql/article.php/3633696/MDX-Operators-The-IsLeaf-Operator--Conditional-Logic-within--Calculations.htm
    http://www.mdxpert.com/Functions/MDXFunction.aspx?f=22
    Regards,
    Charlie Liao
    TechNet Community Support

  • Not able to sign into Blackberry Protect. Backup and Restore function not working. "Your device isn't associated with a Blackberry ID"

    Not able to sign into Blackberry Protect.  Backup and Restore function not working. Message is: "Your device isn't associated with a Blackberry ID."  My Blackberry Messenger and Blackberry World is working fine so I am sure its not an ID issue on the phone.  I can sign into Link, Blackberry.com and Protect.  I see my device in Protect but cannot send messages or view it on a map.  Times out with cannot reach device message.  BB Protect on Device has a swirling circle beside the on/of switch.  Cannot turn off.  
    I have deleted Link and re-installed.
    I have reset phone to default(factory) and signed in. 
    OS level is 10.2.1.3062
    BB Link is 1.2.3.56
    Solved!
    Go to Solution.

    I managed to figure this out myself. I had to delete the device from the Blackberry Protect website.  protect.blackberry.com.  I wiped my device again and signed in with my Blackberry ID.  I dont know if the step of wiping was necessary as I did not try my backup with the current configuration on the device following the delete.  Restore is in progress for me!

  • In my numeric key pad I can not use the (.) dot because it has a (,) and it is not working in calculations.  What I can do?

    In my numeric key pad I can not use the decimal dot (.) because it has a (,) and this not work with decimal calculations.  What I can do?  Help ………

    IT NOT WORK IN MEXICO.  THANKS A LOT.  BEST REGARDS.  MANUEL LOPEZ
    El 6/2/2015, a las 16:50, Apple Support Communities Updates <[email protected]> escribió:
    You received a reply
    SGIII has replied to your question. You can view the full discussion in Apple Support Communities.
    In my numeric key pad I can not use the (.) dot because it has a (,) and it is not working in calculations.  What I can do?
    Correct Answer Helpful Answer
    Use the buttons above to tell SGIII and the rest of the community if this reply solved your question or helped you get closer to finding a solution.
    To reply to SGIII, go to the discussion in Apple Support Communities.
    You are receiving this email from Apple Support Communities. You can change your email preferences in your Apple Support Communities Profile.
    TM and copyright © 2014 Apple Inc. 1 Infinite Loop, MS 96-DM. Cupertino, CA 95014.
    All Rights Reserved | Privacy Policy | Terms of Use | Apple Support

  • Copy/paste function not working in Firefox 22. Always good in previous versions

    Copy/paste function not working in Firefox 22. Always good in previous versions editions

    Well I've uninstalled FF22, thanks for the suggestion.
    Chrome works perfectly with ZA and C&P.

  • Why is the scroll function not working after accessing the voice feature in settings?

    Why is the scroll function not working after accessing the voice feature in settings?

    For some prerecorded audio files the Transpose slider will not work reliably. I found no clear pattern, when it does and when not.
    If all fails, create a loop from the audio file. Select the region in the track and use the command "File: Add region to Loop library".
    Set the current key and tempo, name the loop, and save the loop.
    Now add it from the loop browser to a new track and delete your old track. The search field in the Loop browser will help you to find the loop quickly.
    You will be able to transpose the sample as described above, like a regular loop.
    For example - a audio file turned into a loop and transposed:

  • Palm Desktop 6.2.2. and Lookup function not working in Windows 7

    Palm Desktop's lookup function not working in Windows 7 64bit. Please help.
    Post relates to: Centro (Verizon)
    This question was solved.
    View Solution.

    I was able to solve this by unchecking compatibility mode and setting the application to run as administrative.

  • Send & Recieve functionality not working with  WebDav after installing Acrobat XI

    Send & Recieve functionality not working with  WebDav after installing Acrobat XI for PDF.  Acrobat XI is complete installations(Trial Version).

    Hi Kiro ,
    Did you try opening that file in any other browser ?If not ,please try doing that once and see if that  works for you.
    Try Repairing Acrobat once and see if  that helps.
    Launch Acrobat>Navigate to Help>Repair Acrobat Installation.
    Regards
    Sukrit Dhingra

  • Keyboard + mouse functions not working

    After updating InDesign CC 6-days ago started to have issue with all keyboard + mouse functions not working ex. shift key does not constrain proportions when scaling. A restart fixed the issue thr first time. Today I have installed latest update and shut down and restarted several times does not fix issue. On a MacBook pro running OS X Mavericks 10.9.2.

    Disconnected extrenal devices ie keyboard and Wacom Bamboo tablet and restarted computer seemed to correct the issue.

  • In my ipad zoom function not working..some day before it worked,but when i double pinch with my three fingers it zooms negligible, wat to do?plzz help me..

    In my ipad zoom function not working..some day before it worked,but when i double pinch with my three fingers it zooms negligible, wat to do?plzz help me..

    It works when I reset my all settings...
    Settings>general>reset>reset all settings
    It never delete ur all contacts and any others,but ur wallpaper and wifi connection will change..it can be as before...

  • HT204168 touch screen function not working when using facetime

    Why is my iPad touch screen function not working when using FaceTime?

    Hi megascones,
    I apologize, I'm a bit unclear on the exact nature or scope of the issue you are describing. If you are having issues with the touch screen on your iPad, you may find the troubleshooting steps outlined in the following article helpful:
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Regards,
    - Brenden

  • Why is my touch screen function not working when using facetime

    Why is my touch screen function not working when using facetime

    Hello megascones,
    After reviewing your post, it sounds like the screen is not responding to touch in one app. I would recommend that you read this article, it may be able to help the issue.
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Restart your device. If you can't restart, reset your device.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • HT1977 I bought apps. My kid delet that after few weeks. Then I have downloaded to same ipad. But some functions not working.

    I purchase some apps, my son deleted some. But I have download again from cloud. But some functions not working ask me to pay again. How can I use functions without paying again.   Thank you

    Search around on the app settings and see if there's a "Restore purchases" option.

  • After upgrading to maverick; help & other functions not working

    After upgrading to maverick; help and other functions not working?

    Sometimes just closing and reopening the Help window will clear up the problem. If it doesn't, log out or restart the computer and try again. Otherwise, you may need to delete the Help cache.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Caches/com.apple.helpd
    Right-click or control-click the highlighted line and select 
    Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder selected. Move the selected folder to the Trash. Log out, log back in, and test. Help pages will be slow to load at first.
    If that doesn't work, the problem may be caused by network conditions. It may go away by itself, though I can't say how long you should wait.
       A persistent failure to load help data has been reported as an issue with satellite networks. Test on a different network, if possible. I've also seen at least one report that Photo Stream in iCloud can mysteriously interfere with Help. I'm not sure whether that's true, but try disabling Photo Stream, if applicable.*If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combinationcommand-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar and paste into the box that opens by pressing command-V. You won't see what you pasted because a line break is included. Press return.

  • LAG Function not accepting a default value

    Hi,
    I'm trying to create a calculation using the LAG function and it won't allow me to enter a default value. Currently the condition is LAG(Work Order Headers WOI.Service Dt,1) OVER(PARTITION BY Work Order Headers WOI.Equipment Ident ORDER BY Work Order Headers WOI.Service Dt ) but I want/need it to be LAG(Work Order Headers WOI.Service Dt,1,trunc(sysdate)) OVER(PARTITION BY Work Order Headers WOI.Equipment Ident ORDER BY Work Order Headers WOI.Service Dt ).. so adding the 'default' value of trunc(sysdate). I have tried other examples not using dates and I get the same problem. It gives a Too many arguments supplied to function LAG error.
    We are using Discoverer 10.1.2.45.46c.
    Is this a known problem with our version ?

    Further. I did try to create a custom folder in the Admin layer and it allows the 'default' value.

Maybe you are looking for

  • How do i hide my hdd?

    How do I hide my hdd from my desktop?

  • Running reports in CMC or Infoview

    Hi , I am trying to run few on-demand reports in CMC, but I get this error after I enter the parameter values The database logon information for this report is either incomplete or incorrect. This problem occured recently when I changed my Datasource

  • Centering a Flash website?

    Hello all, I am very new to Flash, but I have created a new webpage using Adobe Flash CS5.5, and there are a few things I am unsure about, one of them being centering the flash document on a webpage. My project is 1000x563 pixels big, and when I hit

  • Yosemite OS X running slowly, BC Win7 working fine?

    A month or so ago, my 2011 21.5" iMac suddenly started running painfully slowly - spinning beach ball for seemingly simple tasks like opening my applications folder, a browser menu, etc. - making it impossible to actually use for anything. I had been

  • Search Complaints: wrong Statuses are displayed

    Hello Experts. I am working with SAP CRM 7.0 and I have an issue when it comes to searching for Complaints. When I search for all Complaints, I see statuses 'open', 'completed', etc...but I do not see my statuses 'pending', 'concluded' and 'responded