Calculate a measure depending on the value of other dimension

HI,
I would like to know if it’s possible to calculate a measure depending on the value of other dimension. I want to calculate this measure in the Business Model and Mapping. I show you how I am trying to do it:
http://img338.imageshack.us/img338/2496/imagenjp.png
But when I try to make an aggregation of this measure then I get an error of consistency.
I think a good example to make you to understand me is the function TODATE which calculates an aggregation depending on one time dimension. I would like to do the same thing but regarding to the value of other dimension.
Can someone help me? Thanks a lot.

Hi,
Do you have that dimension table as a "Sources" in that BMM folder? if yes, then you can use the "Data Type" option and click on "show all logical sources". Then click on your fact table using which you want to do the calculation and then use this formula. After that you can have the aggregation.
It should work.
Thanks,
Rohit

Similar Messages

  • Shading part of a JTable Cell dependent upon the value of the cell

    Hi
    Was hoping some one woudl be able to provide some help with this. I'm trying to create a renderer that will "shade" part of a JTable cell's background depending upon the value in the cell as a percentage (E.g. if the cell contains 0.25 then a quarter of the cell background will be shaded)
    What I've got so far is a renderer which will draw a rectangle whose width is the relevant percentage of the cell's width. (i.e. the width of the column) based on something similar I found in the forum but the part I'm struggling with is getting it to draw this rectangle in any cell other than the first cell. I've tried using .getCellRect(...) to get the x and y position of the cell to draw the rectangle but I still can't make it work.
    The code for my renderer as it stands is:
    import java.awt.Component;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.table.TableCellRenderer;
    public class PercentageRepresentationRenderer extends JLabel implements TableCellRenderer{
         double percentageValue;
         double rectWidth;
         double rectHeight;
         JTable table;
         int row;
         int column;
         int x;
         int y;
         public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
              if (value instanceof Number)
                   this.table = table;
                   this.row = row;
                   this.column = column;
                   Number numValue = (Number)value;
                   percentageValue = numValue.doubleValue();
                   rectHeight = table.getRowHeight(row);
                   rectWidth = percentageValue * table.getColumnModel().getColumn(column).getWidth();
              return this;
         public void paintComponent(Graphics g) {
            x = table.getCellRect(row, column, false).x;
            y = table.getCellRect(row, column, false).y;
              setOpaque(false);
            Graphics2D g2d = (Graphics2D)g;
            g2d.fillRect(x,y, new Double(rectWidth).intValue(), new Double(rectHeight).intValue());
            super.paintComponent(g);
    }and the following code produces a runnable example:
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.table.DefaultTableModel;
    public class PercentageTestTable extends JFrame {
         public PercentageTestTable()
              Object[] columnNames = new Object[]{"A","B"};
              Object[][] tableData = new Object[][]{{0.25,0.5},{0.75,1.0}};
              DefaultTableModel testModel = new DefaultTableModel(tableData,columnNames);
              JTable test = new JTable(testModel);
              test.setDefaultRenderer(Object.class, new PercentageRepresentationRenderer());
              JScrollPane scroll = new JScrollPane();
              scroll.getViewport().add(test);
              add(scroll);
         public static void main(String[] args)
              PercentageTestTable testTable = new PercentageTestTable();
              testTable.pack();
              testTable.setVisible(true);
              testTable.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }If anyone could help or point me in the right direction, I'd appreciate it.
    Ruanae

    This is an example I published some while ago -
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class Fred120 extends JPanel
        static final Object[][] tableData =
            {1, new Double(10.0)},
            {2, new Double(20.0)},
            {3, new Double(50.0)},
            {4, new Double(10.0)},
            {5, new Double(95.0)},
            {6, new Double(60.0)},
        static final Object[] headers =
            "One",
            "Two",
        public Fred120() throws Exception
            super(new BorderLayout());
            final DefaultTableModel model = new DefaultTableModel(tableData, headers);
            final JTable table = new JTable(model);
            table.getColumnModel().getColumn(1).setCellRenderer( new LocalCellRenderer(120.0));
            add(table);
            add(table.getTableHeader(), BorderLayout.NORTH);
        public class LocalCellRenderer extends DefaultTableCellRenderer
            private double v = 0.0;
            private double maxV;
            private final JPanel renderer = new JPanel(new GridLayout(1,0))
                public void paintComponent(Graphics g)
                    super.paintComponent(g);
                    g.setColor(Color.CYAN);
                    int w = (int)(getWidth() * v / maxV + 0.5);
                    int h = getHeight();
                    g.fillRect(0, 0, w, h);
                    g.drawRect(0, 0, w, h);
            private LocalCellRenderer(double maxV)
                this.maxV = maxV;
                renderer.add(this);
                renderer.setOpaque(true);
                renderer.setBackground(Color.YELLOW);
                renderer.setBorder(null);
                setOpaque(false);
                setHorizontalAlignment(JLabel.CENTER);
            public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int col)
                final JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, col);
                if (value instanceof Double)
                    v = ((Double)value).doubleValue();
                return renderer;
        public static void main(String[] args) throws Exception
            final JFrame frame = new JFrame("Fred120");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            frame.setContentPane(new Fred120());
            frame.pack();
            frame.setLocationRelativeTo(null);
            frame.setVisible(true);
    }

  • Hide Advance table Depending upon the value of dropDown

    Hi,
    I have 2 advance tables. 1st one has a DropDown. Depending upon the value of the dropdown in 1st advance table, the second advanced table should get rendered.
    I tried by getting the value of the dropdown by addingg a PPF and iterating trough the table and I got the value. But when I redirect to the same page, all the selection and other values in 1st advanced table vanish out.
    Can someone help me getting the 2nd table hidden and at the same time retaining the values for the 1st advanced table.
    Thanks in Advance,
    Kaushik Rambhiya

    Kaushik
    Implement PPR for this requirement and dont redirect the page
    Displaying image based selected value of choice bean
    http://oracleanil.blogspot.com/2009/05/ppr.html
    Thanks
    AJ

  • Column displaying as an icon instead of/depending on the value

    Hello,
    I use interactive reports and I've a column (IND_CAMP) that can take 2 values : 0 or 1 (the type of the column is "Number").
    I would like this column displays as an icon, depending on the value (a check box, checked or not).
    Must I change my table or can I do this directly in Apex, for example with the conditional display ?
    Or can I add a column, with a different type, connected to IND_CAMP in my query ?
    thanks for your ideas,
    Fanny

    Hi MDK, thanks for your help,
    I'm sorry but I'm new with Apex and PL/SQL...
    My "checkbox" is in fact only a picture, so I've 2 icons, for example icon1.gif and icon2.gif
    And the value I'm interested in is the value of IND_CAMP (0 or 1).
    Should my query look like this...? :
    SELECT MYTABLE.CDE_CAMP,
    MYTABLE.IND_CAMP
    FROM MYTABLE
    CASE
    IND_CAMP.value WHEN 0
    THEN
    '<img src="#WORKSPACE_IMAGES#icon1.gif" />'
    ELSE
    '<img src="#WORKSPACE_IMAGES#icon2.gif" />'
    ENDI can add a column with the icon and hide the IND_CAMP or I can replace it.
    thanks again,
    Fanny

  • Formula to populate one Person or Group column depending on the value of another Person Group column

    I am looking for a way to popluate the Account information of a Person based on another column where there name in another column.  I have Two Columns   "Name" which is a Person or Group information type and User Account which
    is also a Person or Group Information type.  When an Invidividuals name is entered into the Name column, I what the User Account column to prepolulate.

    Hi,
    For your issue, you can automatically populate User Information depending on the value of another Person or Group column by connectting with User Information List or  connectting with User Profile Web Service:
    http://www.wonderlaura.com/Lists/Posts/Post.aspx?ID=172
    http://blogs.technet.com/b/anneste/archive/2011/11/02/how-to-create-an-infopath-form-to-auto-populate-data-in-sharepoint-2010.aspx
    Best Regards,
    Eric
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Disabling button depending on the Value of a field in a standard page

    Hi,
    How can I disable a button depending on the value selected in a particular field of the same page? Is it possible to do so in a Oracle standard page? Please guide me in resolving this requirement.
    Thanks,
    Swagatika

    Swagatika,
    You can attach PPR event to the textinput field and use method
    pageContext.ForwardImmediatelyToCurrentPage().As process request method will be called again,here you can use method setDisabled(boolean) in OAsubmitButtonBean, to enable or disable your button!
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • ColumnChart color depending on the value of the column

    Hi,
    I'va been trying for 2 days to change the colors of columnseries in a columnchart and it is actually awful. I've tried to do it inline without custom itemRenderer but I quickly understood that it is impossible. I then looked on the internet, and found that it was maybe possible by creating a custom itemRenderer class, extending ProgrammticSkin and implementing IdataRenderer.
    I have tried but am not at all able to retrieve the value of the column inside the itemRenderer. Even more, the so called _chartItem is always null and never never carries anything from anyparent.
    I'm a bit exhausted of trying and getting this value, so if you have some idea, i'll be very grateful.
    Here is the code for my itemRenderer class:
    import flash.display.Graphics;
        import flash.geom.Rectangle;
        import mx.charts.ChartItem;
        import mx.charts.chartClasses.GraphicsUtilities;
        import mx.charts.series.items.ColumnSeriesItem;
        import mx.controls.Alert;
        import mx.core.IDataRenderer;
        import mx.graphics.IFill;
        import mx.graphics.IStroke;
        import mx.skins.ProgrammaticSkin;
        public class ColorRenderer extends ProgrammaticSkin implements IDataRenderer
            public function ColorRenderer():void
                super();
            private var _chartItem:ChartItem;
            public function get data():Object
                return _chartItem;
            public function set data(value:Object):void {
                _chartItem = value as ColumnSeriesItem;
                invalidateDisplayList();
            private static const fills:Array = [0xFF0000,0x00FF00,0x0000FF,
                0x00FFFF,0xFF00FF,0xFFFF00,
                0xAAFFAA,0xFFAAAA,0xAAAAFF];
            override protected function
                updateDisplayList(unscaledWidth:Number,unscaledHeight:Number):void {
                super.updateDisplayList(unscaledWidth, unscaledHeight);
                var g:Graphics = graphics;
                g.clear(); 
                g.beginFill(fills[(_chartItem == null)? 0:_chartItem.element.y]);
                Alert.show(_chartItem.index.toString());
                g.drawRect(0, 0, unscaledWidth, unscaledHeight);
                g.endFill();
        } // Close class.
    } // Close package.
    Thank you

    It worked, thanks
    Date: Wed, 21 Apr 2010 09:03:14 -0600
    From: [email protected]
    To: [email protected]
    Subject: Flex ColumnChart color depending on the value of the column
    Have you looked at doing per-item fills?
    http://help.adobe.com/en_US/Flex/4.0/UsingSDK/WS2db454920e96a9e51e63e3d11c0bf69084-7c3f.ht ml
    This feature lets you define a function that customizes chart item fills based on their values.
    >

  • Variant network depending on the value of the characteristics.

    Hi,
    I want to create a project from a sales order for a configurable material. The problem is that the network should be slightly different depending on the value of the characteristics used in the configurable material. For example, it could happen that one operation should not be executed, or that this operation should take longer because of the characteristics.
    How should I proceed?
    Thanks in advance.
    Regards,
    Luis.

    Thanks for your answers, but I needed a more specific answer. Anyway, in the end I found the solution:
    - I had to create a configuration profile for the standard network (CU41), and then I had to assign the same class as the one assigned to the configuration profile of the configurable material.
    - Then, I run t-code CN02, and I had to select one operation and then I clicked "Extras --> Object Dependencies --> Editor". And finally, I just chose the dependency type and filled it with its corresponding code.
    Still, I have a problem:
    - Is it possible to set the value of the Normal Duration (or any other parameter of the operation) depending on the value of one characteristic?
    For example: The value of my characteristic A is 2, so I want to set Normal Duration = 10*(Value_of_A) = 20 for the first operation of the standard network. Is it possible in standard SAP???
    Thanks!

  • Change the colour of a cell text depending on the value Web Reports (NW04s)

    Hi all,
    does anyone know how to change the color of the text of a cell depending on its value on Web Reports? For example red text for values smaller than zero and blue for values bigger than zero?
    I know you can create exceptions, but that changes the background color of the cell and not the text color
    I have tried modifying the theme but the property "negative text" doesn't related to cell values.
    Thanks
    C
    PD: Point will be awarded!
    Message was edited by:
            Carles Prunera

    This function changes all numeric fields to blue if no css style is set.
    [code]
    function turnblue(){
      var cells =document.getElementsByTagName('a');
      for ( i=0; i<cells.length; i++){
        if ( cells<i>.className == '' ){
          var changeColor = checknumber(cells<i>.innerHTML);
    // additional condition on value
          if (changeColor) {
            cells<i>.style.color = '#0000FF'
    function checknumber(cNumber){
      var x= cNumber
      var anum=/(\d+$)|(\d\.\d$)/
      if (anum.test(x))
        testresult=true
      else{
        testresult=false
    return (testresult)
    [/code]
    hope it helps

  • How do i prepopulate a listbox depending on the value of a textfield

    I am getting an custmerid value in a textfield depending on the selected customer name after getting this value i need to pass this customer id to a rowset query for populating the customer address listbox with that customers addresses only (he has multiple address ) iam doing so by doing setobject(1,custid) on that particular rowset.
    How ever on deploying iam getting invalid parameter binding exception.
    what do i do ? how do i get that customers addresses ?when does the creator look for the parameter bindings in the rowset.or trather when does it execute that particular rowset.?

    Hi,
    Check the following tutorial:
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/2/listbox_components.html

  • Change the Status depending on the value selected in Sales stage

    I want to change the status in opportunity, depending upon what is entered in sales stage.
    I tried to find an appropriate BADI for the same purpose, but couldn't figure out any.
    I was thinking of changing the method do_prepare_output and including the code to get the value of sales stage and set the status. Is this feasible?

    Alternatively, you can enhance the SET method of the sales status and add the logic for status update as well.
    Regards, Kathirvel

  • How to set  color of a  row depending on the value of column in JTable?

    Hi All,
    I have a JTable that add rows when the user clicks on the button. In this way there can be any no. of rows in my table. My table contains five columns. When a new row is added , it is added with new data each time. Also the data of the rows keep on changing time to time.
    My problem is that when the data value for the third column comes out to be -ve then color of the row should be red and if its value is +ve then the color of the row should be green.
    I have tried for this in the way but it is not working properly.
    public Component prepareRenderer(TableCellRenderer renderer,int rowIndex, int vColIndex)
         Component c = super.prepareRenderer(renderer, rowIndex, vColIndex);
    if(rowIndex<table.getRowCount() && change<0 )
              c.setForeground(Color.red);
              c.setFont(new Font("TimesRoman",Font.PLAIN,11));
    else if(rowIndex<table.getRowCount() && change>0)
    c.setForeground(new Color(20,220,20));
         c.setFont(new Font("TimesRoman",Font.PLAIN,11));
    return c;
    where change is the value of the third column.
    Any help is highly appreciated.
    Thanx in advance.
    Regards,
    Har Krishan

    Perhaps you'll find this link useful. It gives a general idea of how you can create and adjust your custom renderer:
    http://www.senun.com/Left/Programming/Java_old/Examples_swing/JTableExamples4.html
    Hope it helps.
    Eugene

  • Settin' default value of a lov depending on the value of another lov

    hi all,
    here is my problem:
    I got two combobox item in my form;
    the first one is customer_id,
    the second one is seller_id,
    what i wanna do is:
    when selecting one customer_id, i want to set the value of the seller_id to the one associated with this customer, and give the enduser to change this value;
    i'm tryin' to do so with bind variables but it doesn't work!
    any help.;
    thanks in advance

    Hi,
    ok got your requirement clear ,see what all you have to
    First of I make clear that by frame what I ment was that when you are in the design phase of the
    and you are in the section of "formating " ,there you have 2 frames which are basically not visible as frames,
    so just forget about that.
    I have implemented the same thing in the emp table intead of your
    your customer_id and the supplier_id.
    I'm assuming that you will be having just one record in the second LOV corresponding to the
    first LOV.
    What I've done is that I have made an entry in the scott.emp table with deptno 40 so that
    for deptno 40 I have just 1 entry ,to simulate your case.
    Note:
    Customer_id type is combobox the lov is LOV_CUSTUMER (this will be equivalent to my DEPT_NO LOV)
    seller_id type is combobox too, the lov is LOV_SELLER (this will be equivalent to my EMPNO_NO LOV)
    1)My driving LOV is in deptno field.
    2)I have the driven LOV in empno field.
    3)Now when I select Operation dept (dept no 40),I get the selected value in the LOV (empno)
    and also rest of the empnos.
    This is how you can achieve the functionality as said by you.
    1)In your second LOV write some thing similar.
    select ENAME, EMPNO from SCOTT.EMP where deptno = :deptno
    union
    select ENAME, EMPNO from SCOTT.EMP where deptno != :deptno
    this is to ensure that you get all the values and at the same time
    are able to use the binding of the second LOV.
    2)In the before display section write something similar.
    declare
    l_empNo varchar2(3000);
    l_deptNo number(4);
    begin
    -- This deptno shows what you selected from the first LOV.
    l_deptNo := p_session.get_value_as_NUMBER(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_DEPTNO',
    p_index => 1);
    --just check  wheather it returned something,at the time of loading it will not return anything,so simply
    --return in that case without doing anything.
    if(l_deptNo is null) then
    return;
    else
    --This query basically fetches the value for your second LOV.
    select empno into l_empNo from scott.emp where deptno = l_deptNo;
    --set the value for the second LOV in the session.
    p_session.set_value(
    p_block_name => 'DEFAULT',
    p_attribute_name => 'A_EMPNO',
    p_value => to_number(l_empNo));
    end if;
    end;
    please try to understand the relationship in my scenario and your scenario.
    Hope this helps.
    rahul

  • How do I populate form fields depending on the value of a list box?

    Hi,
    Can anybody help me out here?
    I'm creating a form where I'm needing to populate a number of fields (first name & last name) based on the value of a list box (values are 1,2,3,4,5,6) ie: if 3 is selected 3 sets of the first name and last name fields populate on the page for the user to fill out.
    At this stage it is just a prototype site and there is no database running behind it.
    Thanks
    Hayden

    This can only be solved if you have javascript coding skills.  Without knowing more about what you want to do and why, I can only show you a skeleton of how your code should look, but consider this form select field -
    <select onchange="populateForm()">
    When a value is selected from that list, the "onchange" event will fire, and will call the javascript function called populateForm().  You need to define a function by that name somewhere on the page -
    <script type="text/javascript">
    //<![CDATA[
    function populateForm(value) {
         if value >0 { document.getElementById("fieldID").style.display='block' }
         if value >1 { .... }
         etc.
    //]]>
    </script>
    The page itself would need to have ALL the fields already in the form, but with those that are to be revealed set to a style of display:none.
    Obviously, this is a skinny skeleton.  Each test in the function would reveal a new field on the page by changing its display style from "none" (which is how they should be set in the code) to "block".  You would need a separate function for each type of field that might need to be chosen.
    If this is well over your head, then I'm afraid you will be out of luck for this particular approach....

  • How to populate a filter field in one page with the value from other page

    Take the classic report with form application.
    on page 1 (report) I have a filter (dbname) for the records that will appear in the report. Say that, I enter "ap02" in the filter and all records where dbname starts with "ap02" will display. It works ok.
    Then I click on "create" button and page 2 appears. I enter all fields except the dbname. This field is generated, at "pre-insert trigger on the table".
    What I want is when I press the button "create" on page 2 to pass the value of the generated dbname field into the filter in page 1 so when that page refreshes I will have only one record on the report page (1). I understand that the dbname at the page 2 level still empty because it is generated by the trigger. How do I have access to that info to populate the filter.
    Thanks for your assistance

    Joe - Work backwards from the value generated during the execution of the trigger. You have the value there so you could save it into a package variable right then (create a package with a variable and assign the value to the variable). Then create a process on the page (after the DML process) to assign the value of your package variable to a page item. Then in the branch back to page 1, pass the item. (Or without messing with the branch, the process could simply assign the package variable directly the the page 1 item -- :P1_ITEM := my_package.my_var; ).
    An alternative would be to use the "returning into" feature of DML to capture the PK of the created record into an item. Then the next page process could use the PK to fetch the new row and get the dbname value for passing to page 1.
    Another option would be to update session state directly in the trigger.
    Scott

Maybe you are looking for

  • How to populate " UnRestricted Stock" key figure from 0IC_C03

    Hello All, There is requirement for us to show a field known as "unrestricted stock" from the info cube 0IC_C03. but there is no such key figure in that info cube. I searched all the forums and learnt that it must be calculated on fly while the repor

  • Difference in analog input and analog output values

    i am using 6014 DAQ card for providing motor speed reference voltage to Driver and reading back speed feedback voltage using LabVIEW 6.0. For this i have used AO Single Update and AI Single scan. Both are in the same while loop.The loop has a Wait ti

  • Test Result set procedure with cursor

    i am really new for oracle and i don't know how to test my result set procedure in oracle. i am now working on Oracle 10g Express Edition. my procedure is below. create or replace procedure "GETORDERSBYCATALOGUECODE" (p_cataloguecode IN VARCHAR2, p_c

  • Header text in SO

    Hello, How can I stop individual from changing text at header level (like pick list text, BOl text ..etc...)

  • AirPort Express ProxySTA

    Hello, I use my AirPort Express to connect either my PS3 or Dish DVR to my wireless network via ethernet. For some reason, whenever the connected device is powered down, it is unable to access the network again, until I restart the AirPort express, t