Handling Null Row wise initialization

Hi,
I am creating row wise initialization block to restrict the number of records returned by a Answers.
I am populating a session variable called, REPS_LIST. When I put the condition,
Fact.REP_ID = VALUEOF(NQ_SESSION."REPS_LIST") the group filter works fine.
I want to handle a situation where REPS_LIST is NULL.In that case,I would to get all the rows from my fact. For this, I put the filter like
Fact.REP_ID = IFNULL( VALUEOF(NQ_SESSION."REPS_LIST"), "Fact".REP_ID)
However when i run the Answers report, it says no value definition for REPS_LIST. How can I handle the null condition here?
Thanks,
Vivek.

John,
It appears that the row-wise session variables can be used only with the equality(=) sign. We can't put them in any other function in that the server convert these variables into comma separated string and replaces the = by IN operator. So if I had following filter
Fact.REP_ID = VALUEOF(NQ_SESSION."REPS_LIST")
then it actually gets translated into something like
Fact.REP_ID IN (1001, 1002, 1003....)
As you suggested, I played with the SQL than going behind the above syntax and was able to achieve what I wanted.
Thanks,
Vivek.

Similar Messages

  • Row wise Initialization - Huge LOV

    We use External table for Authentication & uses row wise Initialization. It is working perfectly fine, but the issue is the list of values (output) from row wise initialization is pretty large (the output SQL will be at least 30 pages). This is alarming the management and mainly the DBA's and atleast once in a week we are experiencing issues with these SQL's. And in near future, the SQL will be extending drastically as the company has acquired another 2 companies and once the integration is completed, the LOV's from row wise initialization will easily go upto 90 to 100 pages. Let me explain you what I did... We have around 10 Init blocks used for Authentication, but I am mainly concerned about 2 (cf_visibility & sc_visibility) as these are used in Security/Group/Permissions/Report Filters. Each report will for sure have these filters attached. Here cf_visibility Init SQL is (SELECT DISTINCT 'cf_list', CHILD_COMPANY_ID FROM COMPANY_VISIBILITY CV, CLIENT_FACILITY CF WHERE CV.ANCESTOR_COMPANY_ID=(SELECT SUBSTR(':USER', 0, (INSTR(':USER', '.')) - 1) FROM DUAL) AND CV.CHILD_COMPANY_ID=CF.CLIENT_FACILITY_ID AND CV.DW_DELETE_DATE IS NULL UNION SELECT DISTINCT 'cf_list', 0 FROM DUAL) and
    sc_visibility Init SQL is (SELECT DISTINCT 'sc_list', CHILD_COMPANY_ID FROM COMPANY_VISIBILITY CV,SERVICE_CENTER SC WHERE CV.ANCESTOR_COMPANY_ID= (SELECT SUBSTR(':USER', 0, (INSTR(':USER', '.')) - 1) FROM DUAL) AND CV.CHILD_COMPANY_ID=SC.SERVICE_CENTER_ID AND CV.DW_DELETE_DATE IS NULL
    UNION SELECT DISTINCT 'sc_list', 0 FROM DUAL)
    and both are row wise initialization blocks. The filter used for all the Groups is [(DEP.Jobs."Client Facility ID" =  VALUEOF(NQ_SESSION."cf_list")) AND (DEP.Jobs."Service Center ID" =  VALUEOF(NQ_SESSION."sc_list"))]. This output LOV for this filter is huge as I said earlier.
    My main goal here is to reduce the size of the SQL to 1 page, I am planning to do that by replacing the LOV list by SQL (Kind of sub query). I started experimenting with only cf_visibility for now. I replaced the existing SQL with (select 'cf_list',
    'SELECT DISTINCT CHILD_COMPANY_ID FROM COMPANY_VISIBILITY CV, CLIENT_FACILITY CF WHERE CV.ANCESTOR_COMPANY_ID=(SELECT SUBSTR('':USER'', 0, (INSTR('':USER'', ''.'')) - 1) FROM DUAL) AND CV.CHILD_COMPANY_ID=CF.CLIENT_FACILITY_ID AND CV.DW_DELETE_DATE IS NULL UNION SELECT DISTINCT 0 FROM DUAL'
    from dual)
    this returns only 1 row, with 1column as cf_list and the next column with the ('SELECT DISTINCT CHILD_COMPANY_ID FROM COMPANY_VISIBILITY CV, CLIENT_FACILITY CF WHERE CV.ANCESTOR_COMPANY_ID=(SELECT SUBSTR('':USER'', 0, (INSTR('':USER'', ''.'')) - 1) FROM DUAL) AND CV.CHILD_COMPANY_ID=CF.CLIENT_FACILITY_ID AND CV.DW_DELETE_DATE IS NULL UNION SELECT DISTINCT 0 FROM DUAL') Note: USER will be replaced with actual User Name.
    But when I run a report in Answers, it throws me an error [nQSError: 17001] Oracle Error code: 1722, message: ORA-01722: invalid number at OCI call OCIStmtExecute. I understand the error as it is clearly mentioned, but my question is "Is there any way not to get that huge list in the SQL"
    Let me show you the SQL generated along with the error. As this is a Report filter I am only attaching the where clause of the Query. (where ( T38857.CLIENT_FACILITY_ID in ('SELECT DISTINCT ''cf_list'', CHILD_COMPANY_ID FROM COMPANY_VISIBILITY CV, CLIENT_FACILITY CF WHERE CV.ANCESTOR_COMPANY_ID=(SELECT SUBSTR(''5700.abcde'', 0, (INSTR(''5700.abcde'', ''.'')) - 1) FROM DUAL) AND CV.CHILD_COMPANY_ID=CF.CLIENT_FACILITY_ID AND CV.DW_DELETE_DATE IS NULL UNION SELECT DISTINCT ''cf_list'', 0 FROM DUAL') ).
    So I also thought if I use REPLACE function and replace 'Single Quote' before and after the SQL statement with 'Space', it may work. So I edited one of the Group's report filter ((DEP.Jobs."Client Facility ID" = Replace('VALUEOF(NQ_SESSION."cf_list")', ''', ' ') but it is throwing an error in the expression builder itself.
    Now I ran out of ideas and seeking any help/guidance from you folks.
    I know this is a very lengthy post as I tried to explain the situation as clearly as possible. I hope someone can assist me in resolving this. Thanks for your Time...
    -Dinee

    can't you make a custom table in the DWH? or use a VPD? Maybe a parameterised database view? What I mean is try to push your logic to the database.
    regards
    John
    http://obiee101.blogspot.com

  • Use Session Variable with row-wise initialization

    Hello,
    I use an initialization block in order to load some translations in my repository (version is 11.1.1.6.BP1) :
    SQL :
    SELECT CODE_KEY, STRING_VALUE FROM "TABLES" WHERE  LANGUAGE_KEY= 'VALUEOF(NQ_SESSION.USERLOCALE)'
    Values :
    CN_INCOMING, Incoming, en
    CN_OUTGOING, Outgoing, en
    CN_INCOMING, Réception, fr
    CN_OUTGOING, Emission, fr
    etc ...
    I checked the row-wise intialization.
    The query is correct and returns the right values (I check in the log file ..).
    So far, So good.
    But when I want to use session variables in a column expression (in repository) like  :
    CASE WHEN "column"="xx" THEN VALUEOF(NQ_SESSION."CN_INCOMING")  ELSE VALUEOF(NQ_SESSION."CN_OUTGOING") END
    I got the error: [nQSError: 23006] The session variable, NQ_SESSION.CN_OUTGOING, has no value definition.
    If I used the same formula directly in Answers it's working correctly.
    Do I have to necessarily do this in answers or is there a way to do this in the repository.
    Thanks in advance
    Regards
    Benjamin

    Yes I already tested this point, when I don't use a row wise initialization it's working, but I don't want to create one variable for each translations that I need to use in column formula if you know what I mean.
    I don't understand why we can't use this kind of variable in this context ..but if I have to create the column in my analysis, I will do that, but it's not really user friendly
    Anyway thanks for your time.

  • Regarding Logical level key and row wise initialization

    Hi Gurus,
    What is the purpose of row wise initialization in external table authentication and when we have to go for row wise initialization.
    Why we have to enable logical level key in hierarchy is this only for getting drill down to the next level if we make two columns as logical level key what will happens. If we want to enable a column as a logical level key what are the character sticks that column should satisfy.
    Thanks,

    1) Row Wise Initialization used to hold multiple values in a variable. Let says SQL gives 4 rows (A,B,C,D) as output. Now I want to hold 4 value in a variable to get this happen we need to go for RowwiseIniziation. If you do not do this at any point in time Variable holds only value A not others. Simply it works as Array.
    2) Level keys define the unique elements in each level and provide the context for drill down. You can make two logical columns as logical key but you need to make sure what to be displayed in your hierarchy by selecting DISPLAY. If you make to as separate logical keys and set Display for both you get two columns in the hierarchy
    http://gerardnico.com/wiki/dat/obiee/hierarchy_level_based

  • Abt Row - Wise initialization

    Hi Gurus,
    What is the use of row wise initialization when we have go for this can i have one scenario for better under standing.
    Thanks,

    Check these
    http://gerardnico.com/wiki/dat/obiee/row-wise
    http://docs.oracle.com/cd/E12103_01/books/admintool/admintool_Variables6.html
    http://obiee10grevisited.blogspot.com/2012/03/row-wise-initialization.html

  • Row-wise Initialization: Use caching

    We have the 'Use Caching' check box available for row-wise initialized system variables. Although I do understand how this is useful as it shortens the login time for users who have logged in before by initializing the session variable from the cache instead of firing the query on the database everytime, I need to understand how this cache mechanism works especially when the overall server caching is disabled.
    I have faced a situation where the session variable was initialized from the cache although the server caching was disabled. Is there any way to purge this cache or set a refresh frequency? As of now I had to uncheck the 'Use Caching' check box to fetch the refreshed results in the session variable. But I believe this is undesirable in the long term.
    Thanks,
    Gaurav

    Had thought so. But then it means that you can use row-wise initialization with caching, only when the underlying data is never going to change. Restarting the BI server is not a viable option to clear the cache in systems which require 100% availability.
    But any ways, thanks for the input Dhar.
    Thanks,
    Gaurav

  • Row wise Initialization - "Session Variable has no value Definition"

    Hi,
    I have gone through other posts relating to this error, but could not find a solution.
    I have defined an initialization block with 'Data Source' as SELECT 'TEST_VARIABLE', cost_center from XX_COST_CENTER.
    In the 'Edit Data Target', i have selected the 'Row Wise Initialization' option.
    When i 'Test' this initialization block, using the 'Test' button, i get the exected output, with all the different Cost Centers being defined.
    However, in the Presentation Services when i add a column and change its formula to VALUEOF(NQ_SESSION.TEST_VARIABLE), i get an error
    +[nQSError: 23006] The session variable, NQ_SESSION.TEST_VARIABLE, has no value definition.+
    Would appreciate some input, to check if i have missed any steps, or am doing something wrong
    Thanks & Regards,
    Ab
    Edited by: obiee_user_ab on Jan 16, 2012 6:25 AM

    Hi,
    Error is caused because no value is returned from the sesision variable for the logged in user, you may check the NQquery.log file to see if the initblock was successfull and if that returned any rows, try setting default value in the session variable
    It might also happen when
    1. You created the variable as Repository variable in RPD and referring as session variable in Answers
    2. It may also happen when you are referring the Session variable Name wrongly in Answers. E.g "Current Week" in RPD (2 Words) and CurrentWeek in Answers (Single word).
    Try to use the same letter case for the name of the variable (upper and lower).
    Hope this helps.
    Regards
    MuRam

  • Row wise initialization

    Hi,
    Can anyone explain how row wise initialization works in OBIEE in steps wise.
    Thanks,
    Lakshmipathi.

    Go through the link
    http://108obiee.blogspot.com/2009/03/external-table-authentication-and-row.html

  • Accessing Row-Wise Initialization variable in OBIEE Answers 11g

    Hi All,
    I need to access row-wise initialized session variable in answers fx section, i came to know from following blog
    http://carpediemconsulting.wordpress.com/
    that i can use VALUELISTOF(NQ_SESSION.ROW-WISE-VAR)) function to get the list of values in answers, but i m getting syntax error in obiee 11.1.1.3
    Any work arounds for this. Please help!!
    Thanks,
    Sreekanth

    You can't, it's only intended for use in the RPD initblocks, it's mainly used to restrict data acces:
    http://www.orastudy.com/oradoc/selfstu/fusion/doc.1111/e16816/biapps_security.htm
    regards
    John
    http://obiee101.blogspot.com/
    http://obiee11g.com/

  • Row wise initialized variable in WHERE clause of other initialization block

    Hi,
    i've following problem.
    I've created a initialization block (called A) that initializes a row wise session variable.
    Ex: SELECT X,Y from Z
    Select statement returns 3 rows (it's a row wise initialization block!!!)
    Then i want to create another initialization block that uses in its WHERE cluase the previous row wise variable
    Ex: SELECT W,T from R where F = VALUEOF(NQ_SESSION.A)
    I have following error: DB2-UDB: SQL10104 Token ; was not valid, valid tokens: ....
    I believe that this error is caused by the fact that VALUEOF(NQ_SESSION.A) is translated by OBIEE in IN (a list of values separated by ; and not by ,).
    Can you suggest me a solution?
    Thanks
    Giancarlo
    P.S. I'm using OBIEE 10G

    You could avoid this by rewriting it as
    select w, t
    from r
    where f in (select y from z where x = 'A')
    Regards,
    Robert

  • Row-Wise Session Variable Initialization Block (Max Rows)

    Hi, we have a problem with Row-Wise Session Variable.
    We'll try to implemented the security with a External Query and a Row-Wise Initialization Block. But when we'll try to open the Web Obiee and the rows of result of the query is more than 3000 rows, the browser is broken. The access is very slowly.
    When the result of Query to Row-Wise Variable is more than 3000 rows and we'll try to open the Web Obiee, we have to close NQServer.EXE process of Obiee Server.
    Is there a best practise or a limit rows in the Row-Wise Initialization Block?.
    Thanks.

    You're Right, the people can't be in 3000 groups.
    Is possible I don't explain my problem correctly.
    We use this Row-Wise Variable for implement Data Level Security. .
    For Example :
    I have a fact table with Offices and Office's Sales.
    And each Obiee User can see many Offices according to their level of security.
    I want filter the fact table using a external SQL table implemented in a Session Row-Wise Variable and a User can have X Offices (In the worst case, 3000 Offices).

  • Update report row wise using row buttons and success message

    Hi Jari,
    Thanks for your reply but i wan't success message in success message region of page and not as popup or alert message.
    for report it is classic report but two columns are text field.
    Thanks
    Manish
    Hi,
    On Demand process you can use HTP.P to output success message after you code.
    Create also exception handler that output error using same HTP.P.
    When you call Ajax in JavaScript
    var ajaxResult=ajaxRequest.get();
    Result you output are in variable ajaxResult.
    You can use e.g. alert
    alert(ajaxResult);
    Refresh report depend lot of what report you have.
    There is lot of posts relating interactive report and classic in this forum.
    It might be good to create sample what you already have done to apex.oracle.com.
    Also creating new post might be good idea as this is answered.
    Regards,
    Jari

    866038 wrote:
    Errors come from trying things that don't work.
    For example, instead of =, using IN VALUEOF(NQ_SESSION.GROUP) or @{session.GROUP} or lots of other things.
    The question is this:
    how can I filter a column in Answers using the GROUP session variable which had been initialized in a row-wise initialization block?
    I can find no way to do it. Mostly it returns no rows.Hi,
    we had a similar requirement, where we have an external name that has project number values. We used row wise initialization to capture all the projects that a user belongs to. Then, we applied the filters at the RPD level, instead of doing it at the report level. From you requirement I see that you are trying to filter the groups based on user login. When a user logs in, he will see the information about the groups that he only belongs to. Correct me if I am wrong here.
    Assuming I am right about your requirement, providing the filter that you need apply in RPD.
    On all the fact tables are joined to the Package Virtual Group dimension, apply the below filter.
    case when 1=1 then (Dim)"."Package Virtual Group" END = VALUEOF(NQ_SESSION."GROUP");
    The reason for use of case statement here is, it converts the logical sql to IN Clause, helping us acheive the exact query that we would want.
    Please Award points if this helps.
    Thanks,
    -Amith.

  • Using row-wise multi-value GROUP system session variable in report filter

    The title says it all except I am using 10g OBIEE.
    What I want to do is filter on the dynamic system session variable GROUP created in a row-wise initialization block.
    The GROUP vriable is being set up correctly and it shows the user dynamically put into the correct groups in Answers.
    (Using the admin tool and looking at the user session, only the initial authentication block variables show up.)
    But if I want to filter using the value of GROUP it doesn't work.
    The obvious way is to choose the filter icon, then choose Add -> Variable -> Session, enter GROUP, and then display results.
    It comes back with no rows.
    Any idea how to do this? I've tried lots of things but none of them work either producing no rows or an error.
    This is the kind of Answers SQL this report is resulting in, which makes sense to me, but produces no rows.
    SELECT "Package Virtual Group (Dim)"."Package Virtual Group" saw_0, "Contact (Fact)"."Contacts All Count" saw_1 FROM "Case/Transaction/ABC" WHERE "Package Virtual Group (Dim)"."Package Virtual Group" = VALUEOF(NQ_SESSION."GROUP") ORDER BY saw_0

    866038 wrote:
    Errors come from trying things that don't work.
    For example, instead of =, using IN VALUEOF(NQ_SESSION.GROUP) or @{session.GROUP} or lots of other things.
    The question is this:
    how can I filter a column in Answers using the GROUP session variable which had been initialized in a row-wise initialization block?
    I can find no way to do it. Mostly it returns no rows.Hi,
    we had a similar requirement, where we have an external name that has project number values. We used row wise initialization to capture all the projects that a user belongs to. Then, we applied the filters at the RPD level, instead of doing it at the report level. From you requirement I see that you are trying to filter the groups based on user login. When a user logs in, he will see the information about the groups that he only belongs to. Correct me if I am wrong here.
    Assuming I am right about your requirement, providing the filter that you need apply in RPD.
    On all the fact tables are joined to the Package Virtual Group dimension, apply the below filter.
    case when 1=1 then (Dim)"."Package Virtual Group" END = VALUEOF(NQ_SESSION."GROUP");
    The reason for use of case statement here is, it converts the logical sql to IN Clause, helping us acheive the exact query that we would want.
    Please Award points if this helps.
    Thanks,
    -Amith.

  • Row-Wise GROUP init block isn't creating the variable

    Hi,
    I have an Init Block to set the GROUP variable using row-wise initialization. When I log into Answers with a user, and then check the session variables from Admin Tool, I don't see the GROUP variable anywhere. It seems like the init block is not creating it.
    I have execution precendence set up the way it should be. I have the groups created in both RPD and Presentation Services. Below is my simple query to try to get it to work:
    SELECT 'GROUP', 'OFFICER' FROM DUAL
    UNION ALL
    SELECT 'GROUP', 'SUPERVISOR' FROM DUAL
    Any ideas?
    Thanks
    Edited by: oroborus on Mar 24, 2010 1:25 PM

    Yes I saw the query in the log, it was successful. I added a simple request to a dashboard to display the value of GROUP, and it seems to be working correctly from there. Do the row-wise variables not show up in Admin tool session monitor?

  • Row Wise Intitialisation block

    anybody tell me in which stiuations we use row wise initialisation block.
    please explain elaborately?
    Thanks in Advance.

    User,
    To hold multiple values in a variable we normally use Row-wise Initialization blocks
    Refer : http://108obiee.blogspot.com/2009/03/external-table-authentication-and-row.html
    PS : Search in Google to find more results
    Thanks,
    Saichand.v

Maybe you are looking for

  • User EXIT/BADI for new creating commitment in transaction TRIP

    Hi, We have a requirement where we do not want to create commitment at the time of creation of expense statement by employee (we are creating expense statement using tcode TRIP), it should post to actual budget at the time of posting of expenses to F

  • Word processor for iPad

    Is there a software or app that is compatible to Microsoft office? It sure beats lugging a laptop if ther is one.

  • Partner determination sold to party and ship to party.

    Hi frnds,   Currently in the customer master in partner function we are maintaining ship to party the same as sold to party , now for some of the customer the ship to party and sold to party are different , so while creating a sales when i enter the

  • BAPI for Txn FB60

    Hi friends,    I want to upload data to transaction FB60. I have found a BAPI 'BAPI_ACC_DOCUMENT_POST' for the same but I am not sure about it.    Can anybody help me or if anybody has used the BAPI for uploading data to Txn FB60.    Thanks in Advanc

  • Need help finding media sroller

    can anyone please help, I am trying to find a news photo scoller like the one in the link I have added. http://www.wheatkings.com/default2.aspx All I know is it might be made in adobe 9. Looking to download one already made, again something like the