Need to extract non empty value thru MDX

Hi All,
I have a requirement where there are 2 measures A and B.. I need to populate the first non-missing value from a layer from A in to B..
tried using HEAD function however looks like in ASO MDX member formulas does not support this ..
Any help would be highly appreciated
Thnks,

I believe the issue is that the formula you are using returns a set and you are looking for a value. Therefore, you need to use the Head function with a function that returns a numeric value (ie: Sum, Max, Avg, etc). In instances like this I typically use the Sum function. Depending on your cube and the rest of your formula, you may need to put some additional work into the formula so that the Sum returns just the value you need, but it just requires getting more specific in your arugments.
The Head formula will bring back the first member or tuples specified, but won't evaluate for non-missing. You may need to also combine the Head forumla with the Filter formula. ex: Sum(Head(Filter([Dimension or Member].SetFunction,[A] <> Missing)),1) You will mostly need to select some other dimension to apply the filter to (like period or scenario). Examples of the SetFunction are Children, Members, Levels(0), etc. If you end up going this route you may want to write out your Sum(Head()) function and and Sum(Filter()) function and validate each independently and then merge. I find this helps when trying to build larger nested functions.
Hope this helps!
Jen

Similar Messages

  • Updating a DB table with only non-empty values of a work area

    Hi everybody,
    Is that possible in ABAP to update a table in the database with a work area, but only with non-empty values of this work area?
    Example:
    data: ls_custom type ZCUSTOMERS_0.
    ls_custom-CUSTOMER = '20'.
    ls_custom-LASTNAME = 'MyName'.
    ls_custom-FIRSTNAME = ' '.
    ls_custom-CURRENCY = ' '.
    update ZCUSTOMERS_0 from ls_custom.  *" I want that the update clause don't do the update with FIRSTNAME  and CURRENCY fields because they have empty values*
    If it's possible, how to do it?
    Thanks & regards,
    Abdel

    Total Questions:  81 (66 unresolved)
    Hi,
    To my understanding you mean if the database table has values
    customer         20
    lastname          somename
    firstname         firstname
    currency          INR
    so now after this
    data: ls_custom type ZCUSTOMERS_0.
    ls_custom-CUSTOMER = '20'.
    ls_custom-LASTNAME = 'MyName'.
    ls_custom-FIRSTNAME = ' '.
    ls_custom-CURRENCY = ' '.
    update ZCUSTOMERS_0 from ls_custom.
    you want the result as
    customer         20
    lastname          Myname
    firstname         firstname
    currency          INR
    Is it so? Then Normal update
    data: ls_custom type ZCUSTOMERS_0.
    ls_custom-CUSTOMER = '20'.
    ls_custom-LASTNAME = 'MyName'.
    update ZCUSTOMERS_0 from ls_custom.
    would do that.
    Thanks,
    Sri.

  • 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

  • Non Empty function in MDX with IIF command

    Hi All ,
    I have a MDX query like:
    IIF(isgeneration([YEAR].CurrentMember, 2),
    iif(isgeneration([TIME].CurrentMember, 4),
    parallelperiod(YEAR.generations(2), 1, [YEAR].currentmember),
    missing
    missing
    Now if I'm trying to write NON EMPTY function like:
    IIF(isgeneration([YEAR].CurrentMember, 2),
    iif(isgeneration([TIME].CurrentMember, 4),
    +NON EMPTY(parallelperiod(YEAR.generations(2), 1, [YEAR].currentmember))+,
    missing
    missing
    then it gives me syntax error.
    Can you please help me how to write NON EMPTY function with IIF statement
    Thanks in advance

    Hi All,
    Any help Please. I'm getting error not only within IIF statement but also in simple MDX query. As a example :
    NonEmptySubset(
    ([Total Rev Measure], time.currentmember)
    This also thrown syntax error. I have tried Non Empty also.

  • 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

  • How to fill empty cells with previous non empty value?

    Hello 
    rows where cat=2 do not have price and i want to fill it with previous value wich cat=1 for every item
    Table named tb
    id        item_no     price         cat 
    1           I1             5           1
    3           I1                          2          the price must be 5   
    4           I1                          2          the price must be 5  too
    9           I1             2           1
    10         I2             10          1
    11         I2             5           1
    15         I2              10        1       
    28         I2                          2        the price must be 10  
    30         I2             2           1
    32         I2             10          1
    filled table must be like that:
    id        item_no     price       cat 
    1           I1             5           1
    3           I1            
    5           2          
    4           I1            
    5          2          
    9           I1             2          1
    10         I2             10        1
    11         I2             5          1
    15         I2             10        1       
    28         I2            
    10        2      
    30         I2             2          1
    32         I2             10         1
    How can i do that?

    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. You have no idea,
    do you? Temporal data should use ISO-8601 formats. Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Why are you so rude to people? Now we have to guess a everything and try to fix your mess. 
    There is no generic “id” in RDBMS; it has to be an industry identifier or “<something in particular>_id”. I like the GTIN. Was that useless vague name supposed to be “<something>_cat” as a category scale? 
    CREATE TABLE Items
    (foo_seq INTEGER NOT NULL, 
     gtin CHAR(15) NOT NULL, 
     unit_price DECIMAL (12,2), 
     foobar_cat CHAR(1) NOT NULL
         CHECK (foobar_cat IN ('1', '2')), 
    CREATE PROCEDURE Add_New_Item
    INSERT INTO Items
    VALUES
    (1, 'I2', 5.00, 1), 
    (3, 'I1', NULL, 2), -- unit price must be 5.00
    (4, 'I1', NULL, 2), -- unit price must be 5.00
    (9, 'I1', 2.00, 1), 
    (10, 'I2', 10.00, 1), 
    (11, 'I2', 5.00, 1), 
    (15, 'I2', 10.00, 1), 
    (28, 'I2', NULL, 2), -- unit price must be 10
    (30, 'I2', 2.00, 1);
    >> rows where cat=2 do not have price and I want to fill it with previous value which cat=1 for every item <<
    Rows in a table are not ordered! There is no concept of “previous row” in RDBMS. This is fundamental. Are you using a sequence that you erroneously call “id”? 
    But that makes no sense! Look at (1, 'I2', 5.00, 1) and then (3, 'I1', NULL, 2). Why does item 'I2' have anything to do with the price of item 'I1'? 
    Can you explain? 
    Table named tb
    id   item_no   price   cat 
    1    'I1',  5    1
    3    'I1',  NULL   2  -- the price must be 5   
    4    'I1',  NULL   2  -- the price must be 5  too
    9    'I1',  2    1
    10   'I2',  10   1
    11   'I2',  5    1
    15   'I2',   10   1   
    28   'I2',  NULL   2   -- the price must be 10  
    30   'I2',  2    1
    32   'I2',  10   1
    filled table must be like that:
    id   item_no   price   cat 
    1    'I1',  5    1
    3    'I1',  5    2   
    4    'I1',  5   2   
    9    'I1',  2   1
    10   'I2',  10   1
    11   'I2',  5   1
    15   'I2',  10   1   
    28   'I2',  10   2   
    30   'I2',  2   1
    32   'I2',  10   1
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • 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

  • Inventory Management (Non-cumulative values)

    Dear experts,
    I want to extract inventory data from 2LIS_03_BF.
    How do I have to configure the Key figures; for example: 0VALSTCKQTY. Is there a need to use Non-cumulative value with in- and outflow as in Content.
    Which other possibilities exist?
    After InfoObject config. - what are the exact next steps?
    Do I load data from the 3 DataSources 2LIS_03_BX, 2LIS_03_BF and 2LIS_03_UM into one DSO first and then into one cube or do I have to split?
    I dont want to use the BC data flow.
    Thanks for your advice.
    Patrick

    hi,
    Please search the Forum for this, this has been discussed many times.
    regards,
    Arvind.

  • Extraction of characterstics values

    Hi,
    We are working on an upgradation project. We need to extract data from the previous SAP system. We are not able to find out the table from which we need to extract the characterstics values for a material. Please help me in this regard.
    Thanks
    Ramakanth

    Hi,
    You can extract it via below method also.
    Go to any of the Material related transection.Then in Material field press F4.
    Then serch via classification.Slect class type and class.
    Then press find button.
    Set the layout.
    Then tansport report list to local file or any.
    Regards,
    Dhaval
    Edited by: Dhaval Choksi on Jul 23, 2008 3:54 PM

  • Extract Non-Consecutive Pages

    I have a 1700-page document and need to extract non-consecutive pages. Can that be done? I'm using AA XI for Mac.

    Hi  cmcilwain1,
    One way to do this is to use the "combine" feature. It allows you to add specific pages from an existing PDF to a new PDF.
    You would use this feature to select the pages you want to extract by deleting the pages you don't want.
    In thumbnail view of Combine Files you can select groups of pages at a time by clicking on a starting page and then shift-clicking on an ending page to select all the pages in between. You can ctrl-click to select individual non-consecutive pages. Hitting the delete key while pages are selected will delete them from the pages to put in the new PDF.
    Here are the steps I recommend in Acrobat:
    First, select File > Create > Combine Files into a single PDF...
    Or "Combine files into a single PDF..." is also listed on the Welcome screen")
    In the Combine Files dialog:
    Click the Options button in the upper right. Ensure that "Show page numbers in thumbnail view" is checked so you can keep track of your pages.
    Click the "Add Files..." button to select your file. Or drag it from the Finder into the Combine Files dialog.
    Once the file is present, click the "+" over the file icon to expand the file into its pages.
    Using the hints above, select the pages you want. You may also re-order the pages by dragging them.
    The thumbnails will retain their original page numbers as you move and delete pages which helps to track what you are doing.
    Once you have the pages you want for your new document, click the "Combine Files" button at the bottom of the dialog.

  • 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

  • Non zero values in the extraction of the planning area

    In our DP implementation we have been trying to extract 2 key figures  from the planning area, one of the key figures might have zero values, when we set the indicator for the non zero values then it only eliminates the records for which both the key figure are zero but that is not what I want. I am trying to have a setting in the data source where we can reject the records even if one of the key figure has zero values.
    Are there any settings for that while we are generating the data source.
    Thanks in advance

    Hi Colin,
    This can be easily solved using a slightly different ABAP routine. You can assign the fields that you need to check into other field symbols and then check the value of those field symbols.
    Here's one possible solution. I based in from the ABAP code you posted.
    field-symbols: <LS_EXTR_BLOCK> TYPE any,
                         <ls_fcst> type any,
                         <ls_hist> type any.
    data: w_pos type sy-tabix.
    loop at ct_data assigning <LS_EXTR_BLOCK>.
    w_pos = sy-tabix.
    assign component '/BI0/9AVCORFCST'
       of STRUCTURE <LS_EXTR_BLOCK> to <ls_fcst>.
    assign component '/BI0/9AVCORHIST'
       of STRUCTURE <LS_EXTR_BLOCK> to <ls_hist>.
    if <ls_fcst> = 0 and <ls_hist> = 0.
      delete ct_data index w_pos.
    endif.
    endloop.
    Aside from the solution above, you can also define the structure of CT_DATA (that's basically the structure of the extract structure of your datasource). You can then assign the contents of CT_DATA to a field-symbol and the delete data using that field symbol.
    Here's an example:
    TYPES:
    TY_DATA_TABLE type table of *PUT THE NAME OF YOUR EXTRACT STRUCTURE HERE*.
    field-symbols:
    <FS_DATA_TABLE> type TY_DATA_TABLE.
    DELETE <FS_DATA_TABLE> WHERE /bi0/9avcorfcst = 0
    and /bi0/9avcorhist = 0.
    You can check the name of the extract structure by viewing table /SAPAPO/TSAREAEX field EXPORT_STRU. You can also see the name of the extract structure in debug mode by looking at the value of the parameter IV_DDIC_REFERENCE.
    Hope this helps

  • Can't change cell's type on a non-empty cell!

    Can't change cell's type on a non-empty cell!
    I need to empty cell, then change the type, then retype the value of a cell.
    Number 3 on Maverics.
    File was created on Numbers 2.3
    Thank you.

    Alazarev,
    Can you post a screenshot showing the problem.  You can select the cell(s) then adjus the formatting as needed using the Cell format tool on the right.

  • Remove null & empty values

    I created a report with multiple fields. I would like to create a generic formula in which it evaluates all the values and if it found a null or empty value it will be replaced by a 'N/A'. I was searching in the forums and I found the following formula
    if  (isnull() or ( ='')) then
           "Display the required text"
    else
    when I tried to use it i had an error that the value must be boolean. Is there is a way where  I can change all the fields as string?? and a assign "N/A"
    or
    how can I assign a "N/A"to a boolean field??
    also  I have approx. 140 fields to evaluate, does the formula can be generic or I will need to create a formula for each variable??
    thanks

    Usually when Crystal runs across a field that is NULL, it immediately stops executing the formula, unless the field is enclosed within IsNull().  However, I'm not sure if that is the case for a parameter being passed to a function.  So, you may be able to create a function like (Formula Workshop -> Create Custom Functions -> Add; basic syntax):
    function DisplayString (inVal as string) as string
    if (isnull(inVal) or (inVal ='')) then
      DisplayString = "N/A"
    else
      DisplayString = inVal
    end if
    If Crystal does stop when passing a NULL value as a parameter, then you could code a similar function (without the isnull()), and check the Convert NULL Database Values to Default option on the File -> Report Options panel.
    You would need to create one such function for each data type that you want to show "N/A" for, and for data types other than string, convert the value to a string when it is not null.
    These functions could then be used in the Display String formula for the field on the report.
    The only other way I can think of achieving this would be to base the report(s) on an SQL Command and convert NULL values to "N/A" there.  It might be a bit easier to do in an SQL Command, but probably not a whole bunch.
    Or, educate your users that when nothing is printed, it means that it's not applicable! 
    HTH,
    Carl

  • How to set/get the values thru Wedbynpro coding for User mapping fields

    Hi All
    In system object we have the user mapping fields like District,city,plant,Salesmanager.
    now we want to set/get the values of these usermapping fields of system object thru webdynpro coding...
    if anybody have sample codes of the same then it would be great help to me
    Thanks in advance
    Thanks
    Trisha Rani

    Hi Kavitha
    Thanks for your reply
    My requirement is exactly as follows.
    1) i have created one portal system object in system administration and also i created usermapping fields in the system object from the usermanagement  in system object.
    i created the user mapping fields like Plant,SalesManager,District etc.
    i also created the system alias name for the same system object
    2)  Now i came to persoanlize link and mapped the system object to the portal user.
    while mapping to the system object we need to enter Mapping userId, Password , once we enter these values and we can also enter the values of usermapping fields which we defined while creating the system object ( for example District,Salesmanager,Plant etc)
    once we enter all the values and click on save then these usermapping  values to be mapped to the portal user.
    3) Now my requirement is , i  want to control the usermapping field values thru webdynpro coding for setting/getting the values.
    I need sample code of the same.
    Please let me know if u need more details on the same.
    Thanks
    Trisha Rani

Maybe you are looking for

  • Can't display a Tile Layer using JAVA API V2 (based on HTML5)

    Hi Experts, I am trying to display a tile layer using JAVA API V2 but i get the below error and nothing shows after that. MAPVIEWER-05501: Map tile layer not found. Check map tile layer name and/or data source name. Source: OM.layer.Tilelayer.getTile

  • Help! adobe acrobat X pro. Cannot edit a pdf.

    help! I have adobe acrobat X pro. Cannot edit a pdf. watched videos, followed directions, nothing. Tried tools, edit document text, recognize text, then tried even to change font, nothing.

  • Database is performing to slow

    Hi all, I have oracle 8i database with only 5GB data. My database is performing too slow. Cal any one tell me step by step which poction and where i have to look for increse the performance. Plz provide me some steps which i should follow. Thanks & R

  • Internal GUI Error when creating Message Mapping.

    Hi Experts, An Unexpected Exception occurs when I try to create a Message Mapping on PI 7.1 EHP1. After that the object is not create but is locked, if I try to create again an error message is displayed saying "Object Message Mapping: mm_efgsdjk | h

  • Why do eps files change in size when I open them in AI cc

    I have  a customer that often submits epss. When I open them in Illustrator CC it always opens them as 8.5 by 11 instead of 3.75 by 2.25 size they should be. If I use preview to open them they are the correct size. Does any one know why this might be