Combobox values based on query

I created combobox but how can I set its record source to be based on a query ?

Well it was no working, however I did it myself like this:
Declare
num number;
my_spid varchar2(9);
my_desc varchar2(25);
myvar varchar2(9);
i number;
BEGIN
select count(*) into num from specialty_master;
i:= 1;
loop
myvar:='SP00'||i;
SELECT description, sp_id INTO my_desc, my_spid FROM specialty_master where sp_id=myvar;
Add_List_Element('SP_ID', i, my_desc, my_spid);
i := i + 1;
exit when i > num;
end loop;
END;
My Sp_id in database was like: SP001,SP002,SP003
I had to use myvar:='SP00'||i because of some rownum problem.
But now my error is: No initial value selected for listbox.
How to set initial value.

Similar Messages

  • Set initial value based on query

    Is it possible to set the initial value of a field based on a query. Kindly advice.
    Regards,
    Careen

    Hi,
    Yes. You can create a VO for your query and map that to the field on your page. Then execute the VO in PR method.
    Or if the field is not based on VO, you can execute your query in PR method using PreparedStatement. Then get the handle of the field and set its value to the value returned in resultSet of the query.
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Set Combobox value based on Datagrid selectedItem

    I have been searching the forums and google for some time now
    and I'm not sure how do this. I populate a datagrid from a
    httpservice call to a php script. The datagrid is displaying
    perfectly. I also populate two comboboxes from the same httpservice
    with specific values. When I select a row in the datagrid, I'd like
    the value of the combobox to change to that which corresponds to
    the value from the datagrid.
    I also have a few TextInput fields mixed in with the
    comboboxes and I'm able to set those to the
    datagridname.selectedItem.item. I would like to do the same for the
    comboboxes.
    The reason is so that I can edit users in a group within a
    database. The comboboxes are for the specific groups that are
    allowed to all users.
    Please let me know if any other information is necessary. I
    didn't think any of my current code would help with this question.
    Any examples would be great, I just couldn't find any....
    Thanks in advance for your time.
    Chris

    Tracy - I think I'm progressing, but I'm still running into
    problems. I've changed the httpservice to call an eventhandler,
    which in turn I use in the datagrid to populate it. I'm sure I
    might need to change something, but it is working.... Once I get it
    all working, I'll stop using lastResult and build event handlers,
    now that I'm starting to get a better grasp on it.
    I do get an error though, stating: "Data binding will not be
    able to detect changes to XMLList "user", need an XML instance."
    Also, I can't seem to get "trace" to work. I'm guessing it should
    be popping up a window? If I do an alert popup, it does show the
    data.
    [Bindable]private var myData:XMLList;
    private function test(oEvent:ResultEvent):void {
    myData = XMLList(oEvent.result);
    trace(myData.toXMLString());
    mx.controls.Alert.show(myData);
    <mx:HTTPService id="getUsers"
    url="https://server/flex/getusers.php" resultFormat="e4x"
    result="test(event)" useProxy="false" method="GET"/>
    <mx:DataGrid id="dgUserDetails" right="5"
    dataProvider="{myData.user}" height="315"
    click="onChangeUser(event)">
    <mx:columns>
    <mx:DataGridColumn headerText="Username"
    dataField="uname"/>
    <mx:DataGridColumn headerText="Group"
    dataField="team"/>
    <mx:DataGridColumn headerText="Status"
    dataField="status"/>
    <mx:DataGridColumn headerText="Last Login"
    dataField="llogin"/>
    <mx:DataGridColumn headerText="Count"
    dataField="lcount"/>
    </mx:columns>
    </mx:DataGrid>
    Now, onto the user editing fields. I'm still trying to figure
    out how to use this example you gave me. I understand the xmlUser
    var and I think I understand the xlGroups var. Not sure how it
    should work though. It looks as though xlGroups tries to get the
    group from allusers under the user name?
    [Bindable]private var _xlcGroups:XMLListCollection;
    private function onChangeUser(oEvent:Event):void {
    var xmlUser:XML = XML(dgUserDetails.selectedItem); //the
    Users dataProvider item
    var xlGroups:XMLList = xmlUser.allusers.group; //this
    depends on your xml structure
    _xlcGroups = new XMLListCollection(xlGroups)
    trace(_xlcGroups.toXMLString() ); //so you can see exactly
    what you have
    Let me try to give a better example of the XML.
    <allusers>
    <user>
    <uname>user1</uname>
    <level>6</level>
    <status>active</status>
    <team>alpha</team>
    <llogin>0000-00-00 00:00:00</llogin>
    <lcount>0</lcount>
    </user>
    <user>
    <uname>user2</uname>
    <level>6</level>
    <status>active</status>
    <team>alpha</team>
    <llogin>2007-03-26 11:31:53</llogin>
    <lcount>128</lcount>
    </user>
    <user>
    <uname>user3</uname>
    <level>1</level>
    <status>active</status>
    <team>bravo</team>
    <llogin>2006-02-17 20:08:23</llogin>
    <lcount>3</lcount>
    </user>
    <group>
    <teamname>alpha</teamname>
    <teamlead>user2</teamlead>
    <teamstatus>active</teamstatus>
    </group>
    <group>
    <teamname>bravo</teamname>
    <teamlead>user3</teamlead>
    <teamstatus>active</teamstatus>
    </group>
    <statusops>
    <status>active</status>
    </statusops>
    <statusops>
    <status>inactive</status>
    </statusops>
    </allusers>
    And here is a more detailed view of the user editing panel.
    Again, I always want the comboboxes to display the data returned
    from the httpservice call. But I want to change the value when the
    user is selected.
    <mx:Panel width="250" height="315" left="5"
    layout="absolute" title="User Details">
    <mx:HBox x="10" y="27" width="210">
    <mx:Label text="Username" width="65"/>
    <mx:TextInput id="adm_username" width="137"
    text="{dgUserDetails.selectedItem.uname}"/>
    </mx:HBox>
    <mx:HBox x="10" y="55" width="210">
    <mx:Label text="Group" width="65"/>
    <mx:ComboBox id="adm_usergroup" width="137"
    dataProvider="{getUsers.lastResult.allusers.group}"
    labelField="teamname"/>
    </mx:HBox>
    <mx:HBox x="10" y="83" width="210">
    <mx:Label text="Level" width="65"/>
    <mx:TextInput id="adm_level" width="137" maxChars="1"
    text="{dgUserDetails.selectedItem.level}"/>
    </mx:HBox>
    <mx:HBox x="10" y="111" width="210">
    <mx:Label text="Status" width="65"/>
    <mx:ComboBox id="adm_activestatus" width="137"
    dataProvider="{getUsers.lastResult.allusers.statusops}"
    labelField="status"/>
    </mx:HBox>
    <mx:HBox x="10" y="137" width="210">
    <mx:Label text="Password" width="65"/>
    <mx:TextInput id="adm_password" width="137" enabled="true"
    backgroundDisabledColor="#C0C0C0" displayAsPassword="true"
    change="adm_chkusr(adm_password)"/>
    </mx:HBox>
    <mx:HBox x="10" y="165" width="210">
    <mx:Label text="Confirm" width="65"/>
    <mx:TextInput id="adm_confirm" width="137" enabled="false"
    backgroundDisabledColor="#C0C0C0" displayAsPassword="true"
    change="adm_chkusr(adm_confirm)"/>
    </mx:HBox>
    <mx:HBox x="10" y="205" width="210">
    <mx:HBox width="50%">
    <mx:LinkButton id="adm_clruser" label="Clear"
    click="clearviewUser()"/>
    </mx:HBox>
    <mx:HBox width="50%">
    <mx:LinkButton id="adm_moduser" label="Modify User"
    enabled="false"/>
    </mx:HBox>
    </mx:HBox>
    <mx:HBox x="10" y="233" width="210">
    <mx:HBox width="50%">
    <mx:LinkButton id="adm_deluser" label="Delete User"
    enabled="false"/>
    </mx:HBox>
    <mx:HBox width="50%">
    <mx:LinkButton id="adm_adduser" label="Add User"
    enabled="false"/>
    </mx:HBox>
    </mx:HBox>
    </mx:Panel>
    Thanks again for your time. I look forward to your response
    as this is driving me crazy.
    Regards,
    Chris

  • Problem in populating lookup values based on the lookup query from database

    HI all
    I have problem of population look-up values based on look-up query
    I am giving the details what i am trying
    I need to populate the values from the UD_LDAP_USR table into the field of UD_USRGRPC_NisNetTriple of type lookup
    i planned to set the properties of lookup as like this
    look up query as select UD_LDAP_USR_COMMON_NAME as NisNetTriple from UD_LDAP_USR
    ColumnNames as UD_LDAP_USR_COMMON_NAME
    Column captions as UD_LDAP_USR_COMMON_NAME
    Column width as 30
    Lookup Column Name as UD_LDAP_USR_COMMON_NAME
    But when i try to add ColumnName as wht i mentioned above i m getting invalid property exception,update failed
    I am not sure about that are we able to use other Connector table prefix with UD into the another processFrom
    Let me give update on this issue
    Urgent,struck my work here
    thanks
    Nagaraj

    Thanks for the reply raghav
    I tried but it was not working
    I gave like what u specified but no use
    It is throwing exception like set look-up query for the field
    Any one help me out on this issue
    Edited by: Nagaraju Chowdary on Jan 21, 2013 3:41 AM
    Edited by: Nagaraju Chowdary on Jan 21, 2013 3:42 AM

  • Problem when querying OLAP for Value based hierarchy

    Hi I have problem when querying OLAP for value based hierarchy , for level based dimension it work fine
    the strange part is if I only put one value, it will work perfectly
    for example if I put only 1 value for that value base hierarchy like CF_HIER::426362, then it will get the correct value for that id 426362
    but if I put multiple value to the list
    CF_HIER::426362
    CF_HIER::424470
    CF_HIER::429073
    CF_HIER::424230
    then only some value will come out correctly, some of them will be 0, I wonder why because if I query using each value, then it show correct value
    for multiple value usually only the top in hirarchy give correct value, but the leaf will give 0, but if I query only the leaf, the leaf will give correct value
    this problem only happen for my value based hierarchy, for the level based hierarchy it work fine both for each value or multiple value in the list
    this is the code how I guery
    ////the "elementIdList" is where the value is (CF_HIER::426362,CF_HIER::424470,CF_HIER::429073,CF_HIER::424230), if I only put single value in this list the query work fine, but if I put multiple value then some value give correct result, some will give 0
    String[] elementIdArr = new String[elementIdList.size()];
              int i = 0;
              for (Long elementId: elementIdList) {
                   String elementIdStr ="";
                   if (hierarchy instanceof MdmLevelHierarchy)
                        elementIdStr = hierarchy.getName()+dimension.getValueSeparationString()+
                                            level.getName()+dimension.getValueSeparationString()+
                                            level.getName()+"_"+elementId;
                   else
                        elementIdStr = hierarchy.getName()+dimension.getValueSeparationString()+
                                            elementId;
                   elementIdArr[i++] = elementIdStr;
              Source myList = dp.createListSource(elementIdArr);
              result = hierarchy.getSource().selectValues(myList);
         Source joinedSource = measure.getSource();
              joinedSource = joinedSource.join(result );
    is there any suggestion where I'm doing wrong?or is it different between querying value based hier with level based hier?
    thanks

    Hi I have problem when querying OLAP for value based hierarchy , for level based dimension it work fine
    the strange part is if I only put one value, it will work perfectly
    for example if I put only 1 value for that value base hierarchy like CF_HIER::426362, then it will get the correct value for that id 426362
    but if I put multiple value to the list
    CF_HIER::426362
    CF_HIER::424470
    CF_HIER::429073
    CF_HIER::424230
    then only some value will come out correctly, some of them will be 0, I wonder why because if I query using each value, then it show correct value
    for multiple value usually only the top in hirarchy give correct value, but the leaf will give 0, but if I query only the leaf, the leaf will give correct value
    this problem only happen for my value based hierarchy, for the level based hierarchy it work fine both for each value or multiple value in the list
    this is the code how I guery
    ////the "elementIdList" is where the value is (CF_HIER::426362,CF_HIER::424470,CF_HIER::429073,CF_HIER::424230), if I only put single value in this list the query work fine, but if I put multiple value then some value give correct result, some will give 0
    String[] elementIdArr = new String[elementIdList.size()];
              int i = 0;
              for (Long elementId: elementIdList) {
                   String elementIdStr ="";
                   if (hierarchy instanceof MdmLevelHierarchy)
                        elementIdStr = hierarchy.getName()+dimension.getValueSeparationString()+
                                            level.getName()+dimension.getValueSeparationString()+
                                            level.getName()+"_"+elementId;
                   else
                        elementIdStr = hierarchy.getName()+dimension.getValueSeparationString()+
                                            elementId;
                   elementIdArr[i++] = elementIdStr;
              Source myList = dp.createListSource(elementIdArr);
              result = hierarchy.getSource().selectValues(myList);
         Source joinedSource = measure.getSource();
              joinedSource = joinedSource.join(result );
    is there any suggestion where I'm doing wrong?or is it different between querying value based hier with level based hier?
    thanks

  • Value based on the periodic unit price(only with pr.ctrl S) field in MatMas

    Dear all,
    There is this field in mateial master called "Value based on the periodic unit price (only with pr.ctrl S)" in accounting view 1,
    1 - May I know what is this field about (in between our company using material ledger).
    2 - May I know why the value of this field are different between our company period 6 and period 7 for this year? what contribute to it? and is it something wrong with different value between two different period or absolutely normal?
    Thanks.
    Tuff

    Hi Tuffy,
    For your 1st query:
    PUP field in Accounting 1 (if ML is active, Price Determination indicator=3) is the result of Actual Costing Run (CKMLCP) closing entry.
    For your 2nd query:
    In most of the cases the values will be different in Previous Period and Current Period. e.g.Period 6 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 6 for Previous Period (i.e. Period 5). Period 7 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 7 for Previous Period (i.e. Period 6).
    The reason for the different values: Price differences, Exchange rate differences, Price/Exchange rate differences from Low lower materials, etc.
    Thanks & Regards,
    ADI

  • Value based on the periodic unit price (only with pr.ctrl S) field in mat.

    Dear all,
    There is this field in mateial master called "Value based on the periodic unit price (only with pr.ctrl S)" in accounting view 1,
    1 - May I know what is this field about (in between our company using material ledger).
    2 - May I know why the value of this field are different between our company period 6 and period 7 for this year? what contribute to it? and is it something wrong with different value between two different period or absolutely normal?
    Thanks.
    Tuff

    Hi Tuffy,
    For your 1st query:
    PUP field in Accounting 1 (if ML is active, Price Determination indicator=3) is the result of Actual Costing Run (CKMLCP) closing entry.
    For your 2nd query:
    In most of the cases the values will be different in Previous Period and Current Period. e.g.Period 6 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 6 for Previous Period (i.e. Period 5). Period 7 values are the results of Actual Costing Run (CKMLCP) in 1st week of Period 7 for Previous Period (i.e. Period 6).
    The reason for the different values: Price differences, Exchange rate differences, Price/Exchange rate differences from Low lower materials, etc.
    Thanks & Regards,
    ADI

  • Preaggregation across value based hierarchy dimension in 11g

    Hi All,
    I have created a cube with 6 dimensions in olap 11g. One of those six dimensions has only one hierarchy which is value based hierarchy. I have chosen level based aggregation as I know at what levels exactly users are going to query. When I was going through the dimensions to choose levels to preaggregate I noticed there were no options available for my value based hierarchy dimension ( I could see "all" option for the same case in 10g) then I tried to look for definitions of underlying objects just to make sure it will preaggregate data across my value based hierarchy dimension.
    I found value set corresponding to my value based hierarchy dimension in <CUBE NAME>SOLVEAGGMAP object , which AWM uses to decide which dimension values to preaggregate but if I do rpr on that value set (rp r<CUBE NAME>SOLVE<DIMENSION NAME>_PVSET) it shows NA so my question is can I pre aggregate across value based hierarchy dimension in olap 11g?
    Olap Version: 11.2.0.1
    AWM version: 11.2.0.1
    Thanks

    Even if you know exactly which levels your users will query, percent based precompute (e.g. 30%) may still be faster in practice because queries are returned using 'sparse looping' instead of 'dense looping'. This was the single biggest performance advantage of 11g over 10g.
    But if you still want to use level based precompute, then you should look at the XML template for the cube (as saved by AWM, for example). In it you should find something called PrecomputeCondition. This defines the set of members that are precomputed. Here is an example I just created using the GLOBAL schema
    <PrecomputeCondition>
    <![CDATA[
      "TIME" LEVELS ("TIME"."MONTH", "TIME".CALENDAR_QUARTER, "TIME".CALENDAR_YEAR),
      CHANNEL LEVELS (CHANNEL.TOTAL_CHANNEL, CHANNEL.CHANNEL),
      CUSTOMER LEVELS (CUSTOMER.MARKET_SEGMENT, CUSTOMER.REGION, CUSTOMER.SHIP_TO),
      PRODUCT LEVELS (PRODUCT.CLASS, PRODUCT.FAMILY, PRODUCT.ITEM)]]>
    </PrecomputeCondition>The PrecomputeCondition is also visible through the USER_CUBES view.
    SELECT PRECOMPUTE_CONDITION
    FROM USER_CUBES
    WHERE CUBE_NAME = 'MY_CUBE';You can hand modify this condition in the XML to specify an alternative 'non level based' precompute condition for any dimension. For example, if you define an attribute named 'SHOULD_PRECOMPUTE' on your PRODUCT dimension that is 1 for members to be precomputed and 0 for all others, then you can change the condition as follows.
    <PrecomputeCondition>
    <![CDATA[
      "TIME" LEVELS ("TIME"."MONTH", "TIME".CALENDAR_QUARTER, "TIME".CALENDAR_YEAR),
      CHANNEL LEVELS (CHANNEL.TOTAL_CHANNEL, CHANNEL.CHANNEL),
      CUSTOMER LEVELS (CUSTOMER.MARKET_SEGMENT, CUSTOMER.REGION, CUSTOMER.SHIP_TO),
      PRODUCT WHERE PRODUCT.SHOULD_PRECOMPUTE = 1]]>
    </PrecomputeCondition>If you recreate the cube from the XML with this condition, then the PVSET valueset you discovered should contain all dimension members for which the attribute value is 1.   This gives you complete control over what is precomputed.   Note that AWM doesn't support this form of condition, so it won't show up if you go to the Precompute tab, but it is valid for the server.  The PL/SQL below will modify the PrecomputeCondition (for the cube named MYCUBE) without going through AWM.
    begin
      dbms_cube.import_xml(q'!
    <Metadata
      Version="1.3"
      MinimumDatabaseVersion="11.2.0.2">
      <Cube Name="MY_CUBE">
        <Organization>
          <AWCubeOrganization>
            <PrecomputeCondition>
              <![CDATA[
               "TIME" LEVELS ("TIME"."MONTH","TIME".CALENDAR_QUARTER, "TIME".CALENDAR_YEAR),
               CHANNEL LEVELS (CHANNEL.TOTAL_CHANNEL,CHANNEL.CHANNEL),
               CUSTOMER LEVELS (CUSTOMER.MARKET_SEGMENT,CUSTOMER.REGION,CUSTOMER.SHIP_TO),
               PRODUCT WHERE PRODUCT.SHOULD_PRECOMPUTE = 1]]>
            </PrecomputeCondition>
          </AWCubeOrganization>
        </Organization>
      </Cube>
    </Metadata>
    end;
    /

  • Problem in code of exit to derive a variabble value in BW query

    Hi All,
    In BW query for balance sheet related, i am using customer exit to get the previous cycle value based on the current planning cycle along with the current cycle. I have done some coding in my project enhancment in enhancement RSR00001. Its returning back the previous cycle period but when i run my query its not giving amount details for previous cycle , it just giving blank cycle.
    Please help me to know how get amount details for the previous cycle along with current cycle.
    Thanks in advance.
    Regards,
    Vishal

    Thanks for ur reply,
    Yes, amount data is available in cube for the previous cycle. Below is my code.
    data : T_cycle type i,
           i_cycle(2) type c.
    DATA: L_S_RANGE TYPE RSR_S_RANGESID,
           LOC_VAR_RANGE type RRRANGEEXIT.
    statics : flag type i value 0.
    *read table I_T_VAR_RANGE with key low = '10' into T_T_VAR_RANGE.
    CASE I_VNAM.
    WHEN 'ZECYCLE1'.
       IF I_STEP = 2.
         loop at i_t_var_range into loc_var_range where vnam = 'ZPCYCLE1'.
            clear L_S_RANGE.
            IF loc_var_range-low = 1.
               L_S_RANGE-low = 12.
               flag = 1.
            else.
               T_cycle = loc_var_range-low.
               t_cycle = t_cycle - 1.
               i_cycle = t_cycle.
               L_S_RANGE-low = i_cycle.
            endif.
               L_S_RANGE-high = loc_var_range-low.
               L_S_RANGE-sign = 'I'.
               L_S_RANGE-opt = 'EQ'.
               append L_S_RANGE to E_T_RANGE.
               exit.
         endloop.
       endif.
    when 'ZEPRYEAR'.
       IF I_STEP = 2.
         loop at i_t_var_range into loc_var_range where vnam = '0P_FYEAR'.
            clear L_S_RANGE.
            IF flag = 1.
               t_cycle = loc_var_range-low.
               t_cycle = t_cycle - 1.
               i_cycle = t_cycle.
               L_S_RANGE-low = i_cycle.
               L_S_RANGE-high = loc_var_range-low.
               L_S_RANGE-sign = 'I'.
               L_S_RANGE-opt = 'BT'.
            else.
               L_S_RANGE-low = loc_var_range-low.
               L_S_RANGE-high = loc_var_range-high.
               L_S_RANGE-sign = 'I'.
               L_S_RANGE-opt = 'EQ'.
            endif.
               append L_S_RANGE to E_T_RANGE.
               exit.
         endloop.
       ENDIF.
    ENDCASE.

  • Timestamp data type on S[range C on E] constant value-based range windows

    Hello,
    My questiong is about how can we use timestamp value on S[range C on E] constant value-based range windows.
    I have a LotEvent which i should collect and sum lastQty data for last ten minutes of market time (sendDate)
    A normal [range 600] query does not work for me because i would like to use the exact time which data has been generated by the market (sendDate).
    Here is the event;
    public class LotEvent{
         private Double totalQty;
         private float lastQty;
         private String symbol;
         private String messageType;
         private Integer dataInterval;
         private String sendDate;
    send date is always in "MM-dd-yyyy HH:mm:ss" format.
    I have tried to use the following query but this gives an error;
    Invalid statement: "select symbol, sum(lastQty) as lastQty, 10 AS dataInterval
    +from lotInputChannel [range INTERVAL "0 0:0:15.0" DAY TO SECOND on >>sendDate<<]+
    group by symbol"
    Cause: Datatype char is not valid for value based windows
    Action: Use a valid datatype for value based windows>
    Here is the CQL;
    <?xml version="1.0" encoding="UTF-8"?>
    <wlevs:config xmlns:wlevs="http://www.bea.com/ns/wlevs/config/application">
    <processor>
    <name>lotProcTenMin</name>
    <rules>
         <query id="tenMin"> <![CDATA[select symbol, sum(lastQty) as lastQty, 10 AS dataInterval 
                from lotInputChannel [range INTERVAL "0 00:10:00.0" DAY TO SECOND on sendDate]
    group by symbol]]> </query>
    </rules>
    </processor>
    </wlevs:config>
    i have tried this cql after changing the sendDate data type to long which is the time in milliseconds value but it did not work.
    select symbol, sum(lastQty) as lastQty, 10 AS dataInterval
    from lotInputChannel [range INTERVAL "0 00:10:00.0" DAY TO SECOND on to_timestamp(sendDate)]
    group by symbol
    The query above does not work also when sendDate is a String in "MM-dd-yyyy HH:mm:ss" format
    At last i tried the following query with sendDate as time in milliseconds (long) value. It works! but i still would like to know how to use timestamp in S[range C on E] queries
    select symbol, sum(lastQty) as lastQty, 10 AS dataInterval
    from lotInputChannel [range *600000* on sendDate]
    group by symbol
    public class LotEvent{
         private Double totalQty;
         private float lastQty;
         private String symbol;
         private String messageType;
         private Integer dataInterval;
         private long sendDate;
    Could anybody please help me with this issue?
    Edited by: user8830791 on 01-Aug-2011 06:39

    It seems that you should configure the channel "lotInputChannel" as an application timestamped channel.
    You can do that as follows -
    - Have "sendDate" as a long and let its unit be milliseconds
    - Use the following child elements of <channel> for the "lotInputChannel"
    <wlevs:application-timestamped is-total-order="true">
    <wlevs:expression>sendDate*1000*1000</wlevs:expression>
    </wlevs:application-timestamped>
    The multiplication by 10^6 is required since the units need to be converted into nanos
    With this, you could use the query -
    select symbol, sum(lastQty) as lastQty, 10 AS dataInterval
    from lotInputChannel [range 10 minutes]
    group by symbol
    Of course, for the above to work, a requirement is that the value of "sendDate" is non-decreasing.
    That is if e1 is before e2 in the "lotInputChannel" then e1.sendDate <= e2.sendDate
    Edited by: Anand Srinivasan on Aug 2, 2011 6:57 AM

  • Adding a custom meta data field which lists out content id based on query

    How can we add a custom meta data filed which lists out content id based on query like dDocType <matches> `AssociatedProduct`?
    Or other alternative would be to have a custom metadata field such that it allows selection of content id using link wizard which we typically use in site studio. It would be preferable to have this second option as it is user friendly. Can we do this on a check-in screen?
    -Pratap

    Thanks for the reply Deepak.
    We got it resolved. We did following changes in /ucm/custom/SiteStudio/resources/ss_custom_field_resources.htm file and it worked cleanly.
    Added following section at the end before body tag
    ===================================================================================================
    <@dynamichtml ss_parent_definition_field_entry@>
         <$include super.std_edit_entry$>
         <$if isQuery and isTrue(isQuery)$></td><td><$endif$>
         <$include ss_contributor_base_scripts$>
         <script type="text/javascript" src="<$HttpRelativeWebRoot$>resources/<$SSContributorSourceDir$>/sitestudio/wcm.contentserver.popup.js"></script>
         <script language="JavaScript">
         function OnSelectParentId()
              var selectParentIdOptions = {};
              selectParentIdOptions.httpCgiPath = '<$HttpCgiPath$>';
              selectParentIdOptions.queryText = 'dDocType <matches> `Country`';
              selectParentIdOptions.coreContentOnly = '<$if coreContentOnly and isTrue(coreContentOnly)$>1<$else$>0<$endif$>';
              selectParentIdOptions.callback = function( returnParams )
                   returnParams = returnParams || {};
                   if( returnParams && returnParams['dDocName'] && ( returnParams.dDocName.length > 0 ) )
                        // Set the actual metadata value
                        <$if isQuery AND isTrue(isQuery)$>
                             for (var i=0; i < document.<$formName$>.elements.length; i++)
                                  var elt=document.<$formName$>.elements;
                                  if (elt.name=="<$fieldName$>")
                                       elt.value = returnParams.dDocName;
                        <$else$>
                             document.<$formName$>.<$fieldName$>.value = returnParams.dDocName;
                        <$endif$>
              WCM.ContentServerPopup.ChooseManagedDocument(selectParentIdOptions);
         </script>
         <input type="button" value="<$lc("wwBrowse")$>..." onclick="OnSelectParentId();">
    <@end@>
    ======================================================================================
    Then modified the section which show xWebsiteSection, xRegionDefinition etc to include my custom meta data defitnion as well ('xParentContentType')
    ===================================================================
    <@dynamichtml std_edit_entry@>
         <$if fieldName and ( fieldName like "xWebsites|xDontShowInListsForWebsites" )$>
              <$include ss_website_query_text_field$>
         <$elseif fieldName and strEquals( fieldName, "xWebsiteSection" )$>
              <$include ss_website_section_field_entry$>
         <$elseif fieldName and strEquals( fieldName, "xRegionDefinition" )$>
              <$include ss_region_definition_field_entry$>
         <$elseif fieldName and strEquals( fieldName, "xParentContentType" )$>
              <$include ss_parent_definition_field_entry$>
         <$else$>
              <$include super.std_edit_entry$>
         <$endif$>
    <@end@>
    ====================================================================
    This worked fine.
    Regards,
    Pratap

  • Return a value based on multiple criteria

    Dear Support Community,
    I am trying to formulate a function so that I am able to return a cell value based on more than one criteria.
    Referring to the attached screen shot, "Local Start Time" refers to the time that a person will start a work shift, and depending on the "sectors" the person's duration of time at work will vary.
    For example, if a person starts work between 07:00am and 07:59am AND the particular shift involves 2 sectors, the allowed time at work is 12H15M. However, given the exact start time, if the shift only involves ONE "sector' the allowed time at work becomes 13H00M etc.
    I am trying to formulate a function whereby I can tell the spreadsheet the local start time AND sectors, and then have the appropriate time returned.
    I hope the above makes sense!
    Thanks
    ST

    Hi ST,
    Print your table and pin it up as a "Ready Reckoner" for humans to refer to.
    Convert your table into a Database, something like this:
    Start
    Finish
    Sectors
    Allowed Duration
    Scenario
    0700
    0759
    1
    13h 0m
    1
    0700
    0759
    2
    12h 15m
    2
    0700
    0759
    3
    11h 30m
    3
    0800
    1259
    1
    14h 0m
    4
    0800
    1259
    2
    13h 15m
    5
    0800
    1259
    3
    12h 30m
    6
    1300
    1759
    1
    13h 0m
    7
    1300
    1759
    2
    12h 15m
    8
    1300
    1759
    3
    11h 30m
    9
    1800
    2159
    1
    12h 0m
    10
    1800
    2159
    2
    11h 15m
    11
    1800
    2159
    3
    10h 30m
    12
    2200
    0659
    1
    11h 0m
    13
    2200
    0659
    2
    10h 15m
    14
    2200
    0659
    3
    9h 30m
    15
    (You may want to check that I have converted correctly)
    Columns A and B have a Custom Format that allows them to be numbers (not Text) with leading zeroes.
    Hide Separator to get rid of the comma
    Show zeroes for Unused Digits to show leading zeroes.
    Then you can enter "Army Time" (24 hour clock with leading zeroes) into a Query table
    Thunderstorms playing havoc here with my internet connection. I will post this now. Watch for the next instalment.
    Regards,
    Ian

  • OBIEE and Oracle OLAP Value Based Hierarchies

    Hi there...
    I have a value based dimension built on Oracle OLAP and want to map it on OBIEE Administration tool.
    I've been using the above link as reference:
    http://www.oracle.com/technology/obe/olap_biee/CreateBIEEMetadata.htm
    There's no option to import from Oracle Multi-dimensional Database. Either to import/configure the view created by OLAP as an Unballanced or Ragged Dimension.
    I also checked this example, but it uses ESSBASE as the multi-dimensional source....
    http://www.rittmanmead.com/2008/08/27/ragged-hierarchy-handling-in-obiee/
    How to map this Ragged Dimension created in OLAP workspace in OBIEE? Any suggestions or directions will be highly appreciated...
    Thanks in advance
    Marcos

    Mark and others,
    You can create OLAP_TABLE views with level columns on top of value-based hierarchies. BI Beans used to do that too behind the scenes in Discoverer Plus OLAP. If you trace the Discoverer session, where you are querying data from Value-based hierarchies, you will see that it also generates OLAP_TABLE views with level columns in it.
    So the question is how to do it. Internally, even for Value-based hierarchies Oracle OLAP keeps track of the "depth" of each value by using a structure called GID_DIMENSION (i.e., Grouping Dimension). Here is an example of a view on top of a value-based hierarchy (CFC_ACCT_GAPP) for RPT_ACCOUNT dimension. You have to know how "deep" your value-based hierarchy is.
    Similar kind of a thing is done by OLAP View Generator application, which I never use - since I always prefer to define my own OLAP_TABLE views.
    This kind of a view can then be used in the RPD of OBIEE.
    select *
    FROM table(OLAP_TABLE ('AW duration session',
    *'DIMENSION RPT_ACCT_ID FROM RPT_ACCOUNT WITH*
    HIERARCHY RPT_ACCOUNT_GAAP_PARENT   FROM RPT_ACCOUNT_PARENTREL(RPT_ACCOUNT_HIERLIST ''CFC_ACCT_GAAP'') INHIERARCHY RPT_ACCOUNT_INHIER
    HATTRIBUTE RPT_ACCOUNT_GAAP_LVL_NUM FROM RPT_ACCOUNT_DEPTHVAL
    FAMILYREL RPT_ACCOUNT_GAAP_LVL1,
    RPT_ACCOUNT_GAAP_LVL2,
    RPT_ACCOUNT_GAAP_LVL3,
    RPT_ACCOUNT_GAAP_LVL4,
    RPT_ACCOUNT_GAAP_LVL5,
    RPT_ACCOUNT_GAAP_LVL6,
    RPT_ACCOUNT_GAAP_LVL7,
    RPT_ACCOUNT_GAAP_LVL8
    FROM RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 127),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 63),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 31),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 15),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 7),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 3),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 1),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 0)
    FAMILYREL RPT_ACCOUNT_GAAP_LVL1_DSC,
    RPT_ACCOUNT_GAAP_LVL2_DSC,
    RPT_ACCOUNT_GAAP_LVL3_DSC,
    RPT_ACCOUNT_GAAP_LVL4_DSC,
    RPT_ACCOUNT_GAAP_LVL5_DSC,
    RPT_ACCOUNT_GAAP_LVL6_DSC,
    RPT_ACCOUNT_GAAP_LVL7_DSC,
    RPT_ACCOUNT_GAAP_LVL8_DSC
    FROM RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 127),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 63),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 31),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 15),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 7),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 3),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 1),
    RPT_ACCOUNT_FAMILYRELVAL(GID_DIMENSION 0)
    LABEL RPT_ACCOUNT_LONG_DESCRIPTION
    ATTRIBUTE ACCOUNT_LDSC    FROM RPT_ACCOUNT_LONG_DESCRIPTION
    ATTRIBUTE ACCOUNT_SDSC    FROM RPT_ACCOUNT_SHORT_DESCRIPTION
    ATTRIBUTE ACCOUNT_TYPE    FROM RPT_ACCOUNT_TYPE
    ATTRIBUTE SOURCE_LEVEL    FROM RPT_ACCOUNT_LEVEL
    ATTRIBUTE CALCULATION     FROM RPT_ACCOUNT_CALCULATION
    ATTRIBUTE CALC_DATA       FROM RPT_ACCOUNT_CALC_DATA
    ATTRIBUTE GAAP_SORT_ORDER FROM RPT_ACCOUNT_GAAP_SORT_ORDER
    ATTRIBUTE RATIO           FROM RPT_ACCOUNT_RATIO
    ATTRIBUTE ACCOUNT_LEVEL   FROM RPT_ACCOUNT_LEVELREL'))

  • Aggregation On Value Based Hierarchy

    Hi
    I am having a problem with aggregation on value based hierarchy
    Well I have a table which will serve as my fact and dimension table
    It is as follows
    ID     Name     MID     Salary
    0     All          
    1     A     0     10000
    2     B     1     9000
    3     C     1     9000
    4     D     1     9000
    5     E     2     8000
    6     F     2     8000
    I created a value based dimension named EMPLOYEE , with child as ID and parent as MID
    I created a cube EMP_SALARY with a measure salary mapped to the Salary column in Employee
    My expectation here is to see the total salary at every level including the salary at that level
    So let us take employee B as an example. He is the manager for employees E and F
    So what I would like to see at level B is sal of B + sal of E + Sal of F = 9000 + 8000 + 8000 = 25000
    But what I get from the cube is 9000. Now is the above possible ? If so please so provide me suggestions
    I can achieve the same by using the following sql query
    select e1.id,rpad('*',2*level,'*') || e1.name,e1.sal,
    select sum(e2.sal)
    from test_emp e2
    start WITH e2.id = e1.id
    CONNECT by PRIOR e2.id = e2.mid
    ) sum_sal
    from test_emp e1
    start with e1.mid is null
    CONNECT by prior e1.id = e1.mid;

    The same basic problem, along with a solution, was discussed in the following thread.
    Re: Value Based Dimension causing Aggrega                         tion problems

  • Security for value based hierarchy + OLAP

    Hi,
    I am using row-level security mechanism described here: http://www.rittmanmead.com/2012/03/obiee-11g-security-week-row-level-security/
    It works well for level based hierarchies... but is there a way to apply it to value based OLAP hierarchy in OBIEE 11.1.1.6?
    My case is:
    - I have parent-child value based hierarchy representing management structure with various depth.
    - of course facts are always linked to leaf members of hierarchy
    - I need to apply security at different levels. E.g. Office manager should have access to one/multiple offices information (basically all employees he manage currently + his previous office before he was moved)
    - In report I display presentation hierarchy that starts at country level and then manager drill to his offices
    - At country level, manager should see a measure aggregate only for his offices (not whole country)
    In relational database there is no problem:
    - I follow rittman blog
    - create session variable that store list of all leaf members of hierarchy (employees) managed by manager
    - with OBIEE "Manage"->"Identity" I apply filter on fact table and get right measure aggregates at all levels of hierarchy
    Issue for OLAP:
    - with OBIEE "Manage"->"Identity" I apply filter on OLAP value based hierarchy
    - in case of filter "MY_BMM"."Org Str"."Org Str Key" = VALUEOF(NQ_SESSION."LEAFS_LIST") -> when manager include hierarchy column to report there are no results because hierarchy starts at country level and he have no access to country data
    - to workaround it I tried: "MY_BMM"."Org Str"."Org Str Key" = VALUEOF(NQ_SESSION."LEAFS_LIST_AND_ALL_ANCESTORS") -> manager can see all aggregates at country level because he have access to country, and OLAP just use country level aggregate
    - IsDescendant("MY_BMM"."Org Str" , VALUEOF(NQ_SESSION."OFFICE_ID")) will work only for single office as we can not use row wise variables here
    One solution I can imagine is to create additional level based dimension that have only 2 levels: "All"->"Org Str Leaf". Then apply filter on this "artifitial" dimension. It is not perfect solution to duplicate dimensions only for security purposes... that's why I ask you for advice if you know better way?
    Regards,
    mudi

    Here is an example, how to set security in OBIEE 11.1.1.5 (or future versions)  against  Oracle OLAP dimensions.
    *(1). Create the Oracle OLAP Hierarchy Descendant View against Value-based hierarchy*
    These views return a row for each ancestor-descendent relationship in the hierarchy. As you can see how easy it is.
    CREATE OR REPLACE VIEW DEPT_DESCENDANTS
    AS
    SELECT 'DEPT' "DIMENSION", 'DEPTHIER' "HIER", ancestor, descendant
    FROM TABLE(OLAP_TABLE('BAWOLAP.BNSOLAP DURATION QUERY', null, 'LIMIT DEPT_HIERLIST TO 'DEPTHIER''',
    'DMNS DESCENDANT AS VARCHAR2(60) FROM DEPT
    DMNS GID_VAL AS NUMBER FROM ___AW_GID_DIMENSION
    MSR ANCESTOR AS VARCHAR2(60) FROM DEPT_FAMILYRELVAL'
    where ancestor is not null
    *(2). Create the User ACL Tables and Populate with Data*
    Create an Access Control list test table by user and Dept. Later this will be populated with production data.
    create table user_dept_acls
    username varchar2(30),
    dept varchar2(60)
    insert into user_dept_acls(username, dept) values ('user1', 'GWM');
    insert into user_dept_acls(username, dept) values ('user1', 'GT');
    insert into user_dept_acls(username, dept) values ('user1', 'SC');
    insert into user_dept_acls(username, dept) values ('user2', 'GWM');
    insert into user_dept_acls(username, dept) values ('user2', 'GT');
    insert into user_dept_acls(username, dept) values ('user3', 'SC');
    commit;
    *(3). Create an Init Block Connection Pool*
    Oracle BI EE requires a separate Connect Pool for Init blocks. It does not allow the default query connection pool to be reused for init blocks. So, we need to create a new init block.
    *(4). Create the ACL Session Variables*
    These session variables hold the list of all members that the user may access.
    Example Session Variable: DEPT_ACL
    Init Block: "Init DEPT_ACL"
    SQL:
    select 'DEPT_ACL', account from user_DEPT_acls where username = ':USER'
    union all
    select 'DEPT_ACL', descendant
    from DEPT_descendants
    where ancestor in (select account from user_DEPT_acls where username = ':USER')
    union all
    select 'DEPT_ACL', ancestor
    from DEPT_descendants
    where descendant in (select account from user_DEPT_acls where username = ':USER')
    The first query block of the init block SQL just selects the members explicitly entered into the ACL table. The second block selects all the descendants of those members from the descendants view. The third block selects all the ancestors to ensure that the user has access to all the members in the drill path starting from the root member.
    Make sure that row-wise initialization is checked in the Variable Target section of the init block.
    *(5). Add the Data Filters*
    In our test case we assigned the data filters to the BIAuthor role, but the filters should be added to whatever role makes the most sense.
    Data filter on "BNSGL"."Department":
    "BNSGL"."Department"."Dept" = VALUEOF(NQ_SESSION."DEPT_ACL")
    *(6). Log in as a Normal User and Query the Hierarchy*
    The user can only see to the members to which they are granted access in the ACL table plus all ancestors and descendants of those members.
    Drill down to the bottom of the hierarchy.
    *(7). Look at the Query Log*
    In the nqquery.log we see that the session variable is expanded into an IN list in the physical SQL query. The BI Server breaks the IN list into two IN lists to avoid the Oracle SQL limit of 1,000 items per IN list.
    Edited by: Nasar Ali-Khan on Jul 2, 2012 8:14 AM

Maybe you are looking for