Ago Function gives NULL values

Friends,
I need help regarding Ago function available at column level in BMM.
I am not at all receiving any error. Unfortunately after Ago function implementation i am getting NULL values for that particular column.
Here are my implementation steps for getting "Month Ago" values for "Amout column" in Sales table.
1. i have created Time dimension hieararchy.
It is like this - Year - > Quarter - > Month - > Actual Date
2. Defining Keys and making them chronological are also done.
3. Actual Date is the PK and joins with my Fact.
4. "Amount" Column in Fact is set to 'Sum'.
5. i created a new column named " Amount Month Ago" and set following logic to its expression builder.
Ago("AR Reserve"."Fact - AR Reserve Calc Dtl"."Amount" ,  "AR Reserve"."Dim - TimeDim"."Month" , 1)
I have not received any error.
Once i pull this new column (Amont Month Ago) into the presentation layer and try to create a Tabular report. It is not showing any value. Other column values are OK as expected.
I know i am missing something important here.
Requesting you all to guide me. I am working on OBIEE 10g.

Hi,
Hitting a 'NULL' value in the report hints me of some issues with the Hierarchy/Content setup of the LTS. I suggest you to enable level 7 log and see if the AGO(<measure>) is being nullified by the BI Server due to incompatible facts.
If it is, then you got to revisit your Period hierarchy and content settings in the Fact LTS. Some generic suggestions are,
1. Create hierarchies for all dimensions available.
2. Set the granularity of the sources in the fact to all available hierarchies.
Hope this helps.
Thank you,
Dhar

Similar Messages

  • Will substr + not function ignore null values ?

    hi guys
    i have a table test with 1 column named (value) of varchar2 type.
    inside this table, i have 3 rows.
    1) 2255
    2) null
    3) 5522
    when i do select * from test where substr(value,1,1) not in ('3'), it only returns me
    row 1) 2255
    row 3) 5522
    but why doesnt it return me row 2 with null value as well ?
    since substr(null) will generate null. and null is also NOT IN ('3'), why doesnt it shows?
    any ideas guys ?

    Because NULL is unknown.
    By definition you cannot say if unknown is IN or NOT IN anything.
    So you have to account for the unknown however you think appropriate, in your case that would mean saying:
    select * from test where substr(value,1,1) not in ('3') OR value IS NULL;
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • I am gettng Null value for file when i am using a UDF as this

    String FName;
    DynamicConfiguration Conf = (DynamicConfiguration) container.getTransformationParameters(). get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
    DynamicConfigurationKey key = DynamicConfigurationKey.create("http:/"+"/sap.com/xi/XI/System/File", "FileName");
    FName = Conf.get (key);
    if (FName == null)
    return "null";
    else
    return FName
    and my error is
    Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'FileName' was configured as mandatory element, but there is no 'DynamicConfiguration' element in the XI Message headplease any on there to help me
    thanking you
    sridahr

    Hi,
    Did u selected the option filename from the Adapter message specific atribute of file adapter.
    When u  run the whole scneario that time this will work if u run the scneario using test message tab of message mapping it will give null value only.
    THe AMSA will work when u test it end to end.
    check it out.
    Advance parameter in file adapter dynamic file name
    Problem in dynamic file name in File reciever adapater
    /people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
    /people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
    chirag

  • SSRS null values, correct on excel

    Dear All, 
    I have a problem. i have a sales measure that should return amount values (Currency). I am applying a unit conversion in SSAS. 
    The problem is that The sales Amount measure is returning correct figures in Excel, but it gives null values in SSRS reports and especially when the cube is processing.
    Any idea what would be the problem ?
    Thanks in advance

    Hi Jorjer,
    According to your description, you created a SQL Server Reporting Services report connect to SSAS database as the data source, now the problem is that when you process the cube, you get the null value on the report, right?
    I have tested it on my local environment, we cannot reproduce this issue. In your scenario, can you get correct data in the dataset query designer when processing the cube? I'd suggest you enable SQL Server profiler to monitor the queries fired by your
    dataset, and then check which part of the query is incorrect.
    Besides, you can use a SSIS package to process the SSAS database at midnight, so that it will not affect users to view SSRS report, please refer to the link below to see the details.
    http://www.mssqltips.com/sqlservertip/2994/configuring-the-analysis-services-processing-task-in-sql-server-2012-integration-services/
    Regards,
    Charlie Liao
    TechNet Community Support

  • REGEXP_SUBSTR for comma delimited list with null values

    Hi,
    I have a column which stores a comma delimited list of values. Some of these values in the list may be null. I'm having some issues trying to extract the values using the REGEXP_SUBSTR function when null values are present. Here are two things that I've tried:
    SELECT
       REGEXP_SUBSTR (val, '[^,]*', 1, 1) pos1
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 2) pos2
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 3) pos3
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 4) pos4
      ,REGEXP_SUBSTR (val, '[^,]*', 1, 5) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    POS P POS P P
    AAA   BBB
    SELECT
       REGEXP_SUBSTR (val, '[^,]+', 1, 1) pos1
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 2) pos2
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 3) pos3
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 4) pos4
      ,REGEXP_SUBSTR (val, '[^,]+', 1, 5) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);
    POS POS POS POS P
    AAA BBB DDD FFFAs you can see neither of the calls works correctly. Does anyone know how to modify the regular expression pattern to handle null values? I've tried various other patterns but was unable to get anyone to work for all cases.
    Thanks,
    Martin
    http://www.ClariFit.com
    http://www.TalkApex.com

    Hi, Martin,
    This does what you want:
    SELECT
       RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 1), ',') pos1
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 2), ',') pos2
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 3), ',') pos3
      ,RTRIM (REGEXP_SUBSTR (val, '[^,]*,', 1, 4), ',') pos4
      ,RTRIM (REGEXP_SUBSTR (val || ','
                          , '[^,]*,', 1, 5), ',') pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);The query above works in Oracle 10 or 11, but in Oracle 11, you can also do it with just REGEXP_SUBSTR, without using RTRIM:
    SELECT
       REGEXP_SUBSTR (val, '([^,]*),|$', 1, 1, NULL, 1) pos1
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 2, NULL, 1) pos2
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 3, NULL, 1) pos3
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 4, NULL, 1) pos4
      ,REGEXP_SUBSTR (val, '([^,]*),|$', 1, 5, NULL, 1) pos5
    FROM (SELECT 'AAA,BBB,,DDD,,FFF' val FROM dual);The problem with your first query was that it was looking for sub-strings of 0 or more non-commas. There was such as sub-string. consisting of 3 characters, starting at position 1, so it returned 'AAA', as expected. Then there was another sub-string, of 0 characters, starting at position 4, so it returned NULL. Then there was a sub-string of 3 characters starting at position 5, so it returned 'BBB'.
    The problem with your 2nd query was that it was looking for 1 or more non-commas. 'DDD' is the 3rd such sub-string.
    Edited by: Frank Kulash on Feb 16, 2012 11:36 AM
    Added Oracle 11 example

  • Incorrect values with AGO function

    Hi,
    I am trying to fix a problem where my AGO function is producing close but not 100% correct values.
    I have:
    Fact Table (pk is by date, employee, and measure keys)
    Dim Date Table (only date, month, quarter, year - very simple) Month and quarter are just numbers (not identified by year)
    Dim Emp Table
    I have a logical dimension hierarchy for Dim Date: Total > Year > Quarter > Month > Date
    In my Logical Fact table, I have a SUM column for the measure. My AGO column is just AGO(Measure (SUM), Dim Date.Month, 1)
    For my report, I have tried a few things.
    If I just use the Month column from my Date table, the AGO numbers are way off. If I do MONTH(Date) instead, the AGO numbers are close, and even accurate most of the time, but sometimes they will be a little bit off, by only 1 or 2 usually.
    I'm having the hardest time trying to figure this out, but one thing I'm suspicious of is the Date table - should Month and Quarter be like 2008-01, 2008-02, instead of just 01, 02?

    It would come as no surprise to me if the datetime dim is incorrect. I have been cleaning up someone else's mess.
    The date dim is just this:
    desc date_dim;
    Name                           Null     Type                                                                                                                                                                                         
    DATE_KEY                       NOT NULL NUMBER(8)                                                                                                                                                                                    
    D_YEAR                         NOT NULL NUMBER(4)                                                                                                                                                                                    
    D_MON                          NOT NULL NUMBER(2)                                                                                                                                                                                    
    D_DAY                          NOT NULL NUMBER(2)                                                                                                                                                                                    
    DATE_VALUE                     NOT NULL DATE                                                                                                                                                                                         
    D_QUARTER                      NOT NULL NUMBER(1)                                                                                                                                                                                    
    6 rows selectedFor today's date:
    DATE_KEY               D_YEAR                 D_MON                  D_DAY                  DATE_VALUE                D_QUARTER             
    20090417               2009                   4                      17                     17-APR-09                 2                     
    1 rows selectedI tried making the logical columns for D_YEAR||D_MON and D_YEAR||D_QUARTER, and added them as non-drillable chronological keys in my hierarchy, but still getting the same results.
    Any ideas?
    Edited by: KevinC_VA on Apr 17, 2009 2:40 PM

  • SUM function to give NULL result

    I am really lost on how I can force the SUM function to give me a NULL result when at least one of the elements is a NULL value. I would appreciate any help.

    The short answer is "you can't". The slightly longer answer is the you can't because most aggregate functions work only on non-null values, so SUM silently ignores NULLS.
    However, you can take advantage of that fact to do what you want.
    SQL> SELECT * FROM t;
            ID GROUPCOL
            33 GROUPA
            50 GROUPA
             5 GROUPA
            21 GROUPA
            43 GROUPA
            58 GROUPB
            10 GROUPB
            29 GROUPB
            10 GROUPB
            37 GROUPB
               GROUPA
    SQL> SELECT groupcol, SUM(id) sum_id, COUNT(*) count_all,
      2               COUNT(id) count_id
      3        FROM t
      4        GROUP BY groupcol;
    GROUPCOL       SUM_ID  COUNT_ALL   COUNT_ID
    GROUPA            152          6          5
    GROUPB            144          5          5Note that count_all is different than count_id. So, we can wrap this query in another to return NULL for the sum of groupa.
    SQL> SELECT groupcol, CASE WHEN count_all = count_id THEN sum_id
      2                        ELSE NULL END sum_id
      3  FROM (SELECT groupcol, SUM(id) sum_id, COUNT(*) count_all,
      4               COUNT(id) count_id
      5        FROM t
      6        GROUP BY groupcol);
    GROUPCOL       SUM_ID
    GROUPA
    GROUPB            144Although, I too would be interested in the answer to 405764's question.
    John

  • How to give not null value in a rule for a field

    hi,
    i want to create a rule through rule designer where i want a field say "country" should not be left blank. when i go to the rule designer and select country through attribute value i get 2 conditions "=" and "!=" what shoud i give the value as so that the country field is not null.
    TIA

    I don't think you can have null value in the rule designer , rather you can created one more UDF and populate this UDF with something based on the nulllness/not-null of the country field and use this new UDF in the rule .
    Hope this helps .
    Thanks
    Suren

  • Select_list_from_query function null value

    How does one remove the null value when using the select_list_query function?
    So if I have the following:
    SELECT HTMLDB_ITEM.SELECT_LIST_FROM_QUERY(3,id,'SELECT id FROM emp')
    FROM emp
    It currently adds the extra null '%' value.
    Where would I plug in the p_show_null value in the function or is this not possible?

    Thanks for the help. I found out it was the positioning of the NO parameter value.
    If I simply added one 'NO' after the query, it would not recognize it but when I added 2 'NO' 's as displayed below then it removed the null value.
    SELECT HTMLDB_ITEM.SELECT_LIST_FROM_QUERY(3,id,'SELECT id FROM emp', 'NO', 'NO')
    FROM emp
    Thanks again.

  • Is there any function module to give absolute value of a number?

    Hi,
    Is there any function module to give absolute value of a number?
    That has similar functionality to the Built in Function ABS.
    Please let me know.
    Thanks,
    cs

    hi,
    why are you looking for any function module.
    You can easily get it by mathematical function ABS .
    Syntax : <Turget Variable> = ABS <Source Variable>
    \[removed by moderator\]
    Anirban Bhattacharjee
    Edited by: Jan Stallkamp on Jun 27, 2008 4:19 PM

  • Passing values of some chkboxes to a function. Function recieving NULLs:(

    Hi,
    My aim is to pass the values of some checkboxes on a JSP to a function. I performed these steps
    but the function is getting called with NULL values(noticed that while debugging). Could somebody please tell me what I have missed ?
    These are the steps I did
    0. Start with my application module AppModule
    1. Create the custom method on AppModuleImpl.java
    2. Shuttle the method into the selected list of my AppModule's client interface
    3. Open JSP with some checkboxes
    4. In Structure Window, click on UI model and create one
    5. Right click model and click Data Bindings | Actions | Action
    6. Choose function
    7. For each parameter of that function I change its name to a name of a valid checkbox or radio button
    from the JSP page.
    8. Create a submit button with the name of the that function event_FunctionName
    Thanks in advance
    Michal
    p.s. I use Struts, JSP in JDeveloper 10.1.2 on WinXP Pro.
    I am attaching also the JSP page and the UI model xml.
    <%@ taglib uri="http://xmlns.oracle.com/adf/ui/jsp/adftags" prefix="adf"%>
    <adf:uimodelreference model="WEB_INF_JSP_StatPageUIModel"/>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
    <%@ page contentType="text/html;charset=windows-1250"%>
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1250"/>
    <title>a</title>
    </head>
    <body>
    <html:errors/>
    <html:form action="StatPage.do">
    <input type="checkbox" name="checkbox1" checked/>Checkbox1
    <input type="radio" name="grp1" id="r11" value="AND" checked/>
    <label for="r11">and</label>
    <input type="radio" name="grp1" id="r12" value="OR" />
    <label for="r12">or</label>
    <input type="checkbox" name="checkbox2"/>Checkbox2
    <input type="submit" name="event_getStatOptions" value="Calculate"/>
    </html:form>
    </body>
    </html>
    <?xml version='1.0' encoding='windows-1252' ?>
    <DCContainer
    id="WEB_INF_JSP_StatPageUIModel"
    xmlns="http://xmlns.oracle.com/adfm/uimodel"
    version="10.1.2.17.96"
    Package="adf.struts.view"
    FindMode="false"
    EnableTokenValidation="true" >
    <Contents >
    <DCControl
    id="getStatOptions"
    SubType="DCMethodAction"
    Action="999"
    RequiresUpdateModel="false"
    DataControl="AppModuleDataControl"
    InstanceName="AppModuleDataControl.dataProvider"
    MethodName="getStatOptions"
    ReturnName="AppModuleDataControl.methodResults.AppModuleDataControl_dataProvider_getStatOptions_result" >
    <Contents >
    <NamedData
    NDName="checkbox1"
    NDType="java.lang.String"
    NDValue="%null%" >
    </NamedData>
    <NamedData
    NDName="grp1"
    NDType="java.lang.String"
    NDValue="%null%" >
    </NamedData>
    <NamedData
    NDName="checkbox2"
    NDType="java.lang.String"
    NDValue="%null%" >
    </NamedData>
    </Contents>
    </DCControl>
    </Contents>
    </DCContainer>

    Thanks Frank but what I am looking at is Action Binding a checkbox and not Data binding it.
    Either I am hitting a bug here or I am missing something. I will be grateful for reproducing my case.
    If somebody prefers, I can send the code for this example by mail.
    Send me a mail
    mikeeria*interia.pl
    (change * to @)
    1) Create a New Application workspace and accept default values
    2) Right click on Model | New ... | Business Components | Application Module
    3) If Jdeveloper asks for a db connection just choose anything(ex HR schema) and click next
    4) Leave default values for package and Name and click finish
    5) Open AppModuleImpl.java and add the following function just after the default constructor
    public void getStatOptions(String chkbox1,String chkbox2) {
    String variable1;
    String variable2;
    variable1 = chkbox1;
    variable2 = chkbox2;
    6) save all
    7) Right click on the application module | go to client interface | shuttle the getStatOptions function and click ok
    8) Open Struts-Config.xml
    9) Add new data page
    10) In data control palette, select AppModuleDataControl | Operations | getStatOptions
    11) drag and drop as "Button with Form"
    12) Choose HTML from Coponent palette and drag two checkboxes
    13) Change names to chkbox1 and chkbox2
    15) Go to UI Model of JSP page and expand the getStatOptions
    16) Click on "param" and in the Property Inspector window change Name to chkbox1
    17) Click on "param1" and in the Property Inspector window change Name to chkbox2
    14) Go back to AppModuleImpl.java and add a breakpoint on first line of code in getStatOptions function
    18) mark ViewController Node and from menu choose Debug | UI Debug ViewController.jpr
    19) Notice that the function is recieving NULL values
    Many Thanks
    M.

  • LAG & LEAD functions... Any Way to Retrieve the 1st non-NULL Values?

    My question is this... Has anyone found an elegant way of getting the LAG & LEAD functions to move to the 1st NON-NULL value within the partition, rather than simply using a hard-coded offset value?
    Here's some test data...
    IF OBJECT_ID('tempdb..#temp') IS NOT NULL DROP TABLE #temp
    CREATE TABLE #temp (
    BranchID INT NOT NULL,
    RandomValue INT NULL,
    TransactionDate DATETIME
    PRIMARY KEY (BranchID, TransactionDate)
    INSERT #temp (BranchID,RandomValue,TransactionDate) VALUES
    (339,6, '20060111 00:55:55'),
    (339,NULL, '20070926 23:32:00'),
    (339,NULL, '20101222 10:51:35'),
    (339,NULL, '20101222 10:51:37'),
    (339,1, '20101222 10:52:00'),
    (339,1, '20120816 12:02:00'),
    (339,1, '20121010 10:36:00'),
    (339,NULL, '20121023 10:47:53'),
    (339,NULL, '20121023 10:48:08'),
    (339,1, '20121023 10:49:00'),
    (350,1, '20060111 00:55:55'),
    (350,NULL, '20070926 23:31:06'),
    (350,NULL, '20080401 16:34:54'),
    (350,NULL, '20080528 15:06:39'),
    (350,NULL, '20100419 11:05:49'),
    (350,NULL, '20120315 08:51:00'),
    (350,NULL, '20120720 11:48:35'),
    (350,1, '20120720 14:48:00'),
    (350,NULL, '20121207 08:10:14')
    What I'm trying to accomplish... In this instance, I'm trying to populate the NULL values with the 1st non-null preceding value. 
    The LAG function works well when there's only a single null value in a sequence but doesn't do the job if there's more than a singe NULL in the sequence.
    For example ...
    SELECT
    t.BranchID,
    t.RandomValue,
    t.TransactionDate,
    COALESCE(t.RandomValue, LAG(t.RandomValue, 1) OVER (PARTITION BY t.BranchID ORDER BY t.TransactionDate)) AS LagValue
    FROM
    #temp t
    Please note that I am aware of several methods of accomplishing this particular task, including self joins, CTEs and smearing with variables.
    So, I'm not looking for alternative way of accomplishing the task... I'm wanting to know if it's possible to do this with the LAG function.
    Thanks in advance,
    Jason
    Jason Long

    I just wanted to provide a little follow-up now that I had a little time to check up and digest Itzik’s article and tested the code posed by Jingyang.
    Turns out the code posted by Jingyang didn’t actually produce the desired results but it did get me pointed in the right direction (partially my fault for crappy test data that didn’t lend itself to easy verification). That said, I did want to post the version
    of the code that does produce the correct results.
    IF OBJECT_ID('tempdb..#temp') IS NOT NULL DROP TABLE #temp
    CREATE TABLE #temp (
    BranchID INT NOT NULL,
    RandomValue INT NULL,
    TransactionDate DATETIME
    PRIMARY KEY (BranchID, TransactionDate)
    INSERT #temp (BranchID,RandomValue,TransactionDate) VALUES
    (339,6, '20060111 00:55:55'), (339,NULL, '20070926 23:32:00'), (339,NULL, '20101222 10:51:35'), (339,5, '20101222 10:51:37'),
    (339,2, '20101222 10:52:00'), (339,2, '20120816 12:02:00'), (339,2, '20121010 10:36:00'), (339,NULL, '20121023 10:47:53'),
    (339,NULL, '20121023 10:48:08'), (339,1, '20121023 10:49:00'), (350,3, '20060111 00:55:55'), (350,NULL, '20070926 23:31:06'),
    (350,NULL, '20080401 16:34:54'), (350,NULL, '20080528 15:06:39'), (350,NULL, '20100419 11:05:49'), (350,NULL, '20120315 08:51:00'),
    (350,NULL, '20120720 11:48:35'), (350,4, '20120720 14:48:00'), (350,2, '20121207 08:10:14')
    SELECT
    t.BranchID,
    t.RandomValue,
    t.TransactionDate,
    COALESCE(t.RandomValue,
    CAST(
    SUBSTRING(
    MAX(CAST(t.TransactionDate AS BINARY(4)) + CAST(t.RandomValue AS BINARY(4))) OVER (PARTITION BY t.BranchID ORDER BY t.TransactionDate ROWS UNBOUNDED PRECEDING)
    ,5,4)
    AS INT)
    ) AS RandomValueNew
    FROM
    #temp AS t
    In reality, this isn’t exactly a true answer to the original question regarding the LAG & LEAD functions, being that it uses the MAX function instead, but who cares? It still uses a windowed function to solve the problem with a single pass at the data.
    I also did a little additional testing to see if casting to BINARY(4) worked across the board with a variety of data types or if the number needed to be adjusted based the data… Here’s one of my test scripts…
    IF OBJECT_ID('tempdb..#temp') IS NOT NULL DROP TABLE #temp
    CREATE TABLE #Temp (
    ID INT,
    Num BIGINT,
    String VARCHAR(25),
    [Date] DATETIME,
    Series INT
    INSERT #temp (ID,Num,String,Date,Series) VALUES
    (1, 2, 'X', '19000101', 1), ( 2, 3, 'XX', '19000108', 1),
    (3, 4, 'XXX', '19000115', 1), ( 4, 6, 'XXXX', '19000122', 1),
    (5, 9, 'XXXXX', '19000129', 1), ( 6, 13, 'XXXXXX', '19000205', 2),
    (7, NULL, 'XXXXXXX', '19000212', 2),
    (8, NULL, 'XXXXXXXX', '19000219', 2),
    (9, NULL, 'XXXXXXXXX', '19000226', 2),
    (10, NULL, 'XXXXXXXXXX', '19000305', 2),
    (11, NULL, NULL, '19000312', 3), ( 12, 141, NULL, '19000319', 3),
    (13, 211, NULL, '19000326', 3), ( 14, 316, NULL, '19000402', 3),
    (15, 474, 'XXXXXXXXXXXXXXX', '19000409', 3),
    (16, 711, 'XXXXXXXXXXXXXXXX', '19000416', 4),
    (17, NULL, NULL, '19000423', 4), ( 18, NULL, NULL, '19000430', 4),
    (19, NULL, 'XXXXXXXXXXXXXXXXXXXX', '19000507', 4), ( 20, NULL, NULL, '19000514', 4),
    (21, 5395, NULL, '19000521', 5),
    (22, NULL, NULL, '19000528', 5),
    (23, 12138, 'XXXXXXXXXXXXXXXXXXXXXXX', '19000604', 5),
    (24, 2147483647, 'XXXXXXXXXXXXXXXXXXXXXXXX', '19000611', 5),
    (25, NULL, 'XXXXXXXXXXXXXXXXXXXXXXXXX', '19000618', 5),
    (26, 27310, 'XXXXXXXXXXXXXXXXXXXXXXXXX', '19000618', 6),
    (27, 9223372036854775807, 'XXXXXXXXXXXXXXXXXXXXXXXXX', '19000618', 6),
    (28, NULL, NULL, '19000618', 6),
    (29, NULL, 'XXXXXXXXXXXXXXXXXXXXXXXXX', '19000618', 6),
    (30, 27310, NULL, '19000618', 6)
    SELECT
    ID,
    Num,
    String,
    [Date],
    Series,
    CAST(SUBSTRING(MAX(CAST(t.[Date] AS BINARY(4)) + CAST(t.Num AS BINARY(4))) OVER (ORDER BY t.[Date] ROWS UNBOUNDED PRECEDING), 5,4) AS BIGINT) AS NumFill,
    CAST(SUBSTRING(MAX(CAST(t.[Date] AS BINARY(4)) + CAST(t.Num AS BINARY(4))) OVER (PARTITION BY t.Series ORDER BY t.[Date] ROWS UNBOUNDED PRECEDING), 5,4) AS BIGINT) AS NumFillWithPartition,
    CAST(SUBSTRING(MAX(CAST(t.[Date] AS BINARY(4)) + CAST(t.Num AS BINARY(8))) OVER (ORDER BY t.[Date] ROWS UNBOUNDED PRECEDING), 5,8) AS BIGINT) AS BigNumFill,
    CAST(SUBSTRING(MAX(CAST(t.[Date] AS BINARY(4)) + CAST(t.Num AS BINARY(8))) OVER (PARTITION BY t.Series ORDER BY t.[Date] ROWS UNBOUNDED PRECEDING), 5,8) AS BIGINT) AS BIGNumFillWithPartition,
    CAST(SUBSTRING(MAX(CAST(t.ID AS BINARY(4)) + CAST(t.String AS BINARY(255))) OVER (ORDER BY t.ID ROWS UNBOUNDED PRECEDING), 5,255) AS VARCHAR(25)) AS StringFill,
    CAST(SUBSTRING(MAX(CAST(t.ID AS BINARY(4)) + CAST(t.String AS BINARY(25))) OVER (PARTITION BY t.Series ORDER BY t.ID ROWS UNBOUNDED PRECEDING), 5,25) AS VARCHAR(25)) AS StringFillWithPartition
    FROM #Temp AS t
    Looks like BINARY(4) is just fine for any INT or DATE/DATETIME values. Bumping it up to 8 was need to capture the largest BIGINT value. For text strings, the number simply needs to be set to the column size. I tested up to 255 characters without a problem.
    It’s not included here, but I did notice that the NUMERIC data type doesn’t work at all. From what I can tell, SS doesn't like casting the binary value back to NUMERIC (I didn't test DECIMAL).
    Thanks again,
    Jason
    Jason Long

  • AGO function is not returning value in OBIEE 11g

    I have 2 tables FIN_MASTER AND FIN_TRANS. 
    FIN_MASTER  is having the following fields org_code, type_code, vr_no, vr_Date, pay_to .FIN_TRANS is having the columns org_code, type_code, vr_no, acct_code. debit, credit.
    PK of FIN_MASTER is org_code, type_code, vr_no
    PK of FIN_TRANS is org_code, type_code, vr_no, acct_code
    I have imported these two tables in to physical layer and created join between these two tables on the following keys. org_code, type_code, vr_no. Then i dragged these two to BMM layer. Now i created 3 new logical columns in DIM_FIN_MASTER as year, quarter, month. These 3 columns are created using the functions year(vr_date), month(vr_date), quarter_of_year(vr_date). Then i created a dimension heirarchy called TIME( structure type is TIME) from this DIM_FIN_MASTER. and set chronological key on month level. Then I applied the AGO function on debit column with month level. After that, repository is uploaded and BI server is restarted. Now amount is not displaying in AGO function column in analytics. That column is appearing as empty. 
    Please advise me.

    Here is the dirty fix, I'm heading off to sleep.
    If the function CurrentAdId doesn't return a number, then
    this will ensure it returns 0 (prevents your error, may not display
    an ad):
    <CFFUNCTION
    NAME="CurrentAdId"
    ACCESS="Private"
    RETURNTYPE="numeric"
    HINT="For internal use. Returns the Id of the current ad in
    rotation.">
    <!--- Return the adId from the current row of the
    GetAdIds query --->
    <cfset var returnVal = ListGetAt(THIS.AdList,
    THIS.CurrentListPos)>
    <cfif NOT IsNumeric(returnVal)>
    <cfset returnVal = 0>
    </cfif>
    <CFRETURN returnVal>
    </CFFUNCTION>

  • Geting null values from request

    hi!
    i m producing this code through out.println() method in my page and then using java script
    i am submiting this page to another page
    <td width="56%"><textarea name="question_no_1"></textarea></td>
    <input name="question_no_1_radio1" type="radio" value="radio"></td>
    <td width="59%"> <textarea name="question_no_1_ans1"></textarea></td>
    <input type="radio" name="question_no_1_radio2" value="radio"></td>
    <td><textarea name="question_no_1_ans2"></textarea></td>
    <input type="radio" name="question_no_1_radio3" value="radio"></td>
    <td><textarea name="question_no_1_ans3"></textarea></td>
    <input name="question_no_1_radio4" type="radio" value="radio"></td>
    <td><textarea name="question_no_1_ans4"></textarea></td>
    but when i submit it to the other page and try to retrieve value of parameter "question_no_1"
    through the bellow statement it shows a null value but i have given a value previously by
    typing a question in it
    System.out.println("the Body Of The First Question Is "+request.getParameter("question_no_1"));
    can anybody help me what is going on here.
    also if i try to normaly submit first page (ie <form="form1" method="post" action="other_jsp_page.jsp"> ) then the statement in the next page gives me the correct value but
    i have to submit the first paper through java script.
    if u want to see full detail of my code then go to the following link
    http://forum.java.sun.com/thread.jsp?thread=309254&forum=45&message=1237097
    thanx in advance

    OK, your problem is that you are not submmiting the values to the other page. When you do the
    --> document.forms[0].submit();
    in JavaScript, the form has to action defined
    --> <form name="form1" method="" action="">
    So, the page does nothing. The line following the submit just changes the location of the page, IT DOES NOT POST the values.
    One solutions is the following:
    1.- define an action for your form:
    <form name="form1" method="POST" action="'save_paper.jsp">
    2.- Then create a JavaScript function that validates the fields and simply return "true" if the form is correct, and false if there is a problem (just a little modification of the one you have).
    3.- Then modify your submit button:
    Instead of:
    <input type="button" name="Save" value="Save" onClick="validateField()">
    Try:
    <input type="SUBMIT" value="Save" onclick="validateField();">

  • Exclude NULL values from SUM and AVG calculation

    Hi,
    I have column in report that contains some NULL values. When i perform SUM,MAX,MIN or AVG calculation on this column the NULL values are treated as '0' and included in calculation. Is there any way to exclude them while calculating aggregate functions? 
    As a result MIN calculation on values (NULL,0.7,0.5,0.9) gives me output as 0 when it should have been 0.5 
    Can someone please help ?
    Thanks and Regards,
    Oliver D'mello

    Hi Oliver,
    According to your description, you want to ignore the NULL values when you perform aggregation functions.
    In this scenario, aggregate functions always ignore the NULL values, because their operation objects are non-null values. So I would like to know if you have assigned “0” for NULL values. I would appreciate it if you could provide some screenshots about
    your expressions or reports.
    Besides, we have tested in our environment using  Min() function. The expression returns the minimum value among the non-null numeric values. Please refer to the screenshots below:
    Reference:
    Min Function (Report Builder and SSRS)
    Aggregate Functions Reference (Report Builder and SSRS)
    If you have any question, please feel free to ask.
    Best regards,
    Qiuyun Yu

Maybe you are looking for