Calculate the measure of the RPD

Hello! I have a mission to do. I need to calc value depends on the line of the month dashboard. I mean... If the user select March 2008 I must show the value of the sum of the last 12 months (from April 2007 to March 2008). I can do this in the presentation with TIMESTAMPADD layer (SQL_TSI_MONTH, - CAST(11 AS INT)... but I need to calc in logic layer... because I have to join to this calc with the actual value of the month and cum year value and filter TIMESTAMPADD... is a general filter of my report and I have erroneous results...)
I can write an example if you need more information.

Someone help me?

Thank you very much!!!

Hi Alex1,

I also had problems with this in the past. As you mentioned, it straight forward to implement in a query using a C.V. and filter the report on last twelve times. But it isn't really the same functionality to the RPD.

There are only two functions of time series in the repository: there is and up to date. ToDate will do things like months to date, year to date, etc.. In the first year to date seems to be a good fit, but if your 12 month period will last two years (which they almost always do except for December), so it doesn't give you what you want.

There are can give you a single value, but it does not give you a running sum.

What I see, it seems the best idea here is to use the Ago (there are (>, >, >)) work, 12 times, i.e.
Ago(value, month,11) + Ago(VALUE, MONTH,10) + Ago(VALUE, MONTH,9) + Ago(VALUE, MONTH,8) + Ago(VALUE, MONTH,7) + Ago(VALUE, MONTH,6) + Ago(VALUE, MONTH,5) + Ago(VALUE, MONTH,4) + Ago(VALUE, MONTH,3) + Ago(VALUE, MONTH,2) + Ago(VALUE, MONTH,1) + Ago(VALUE, MONTH,0)

It is not the prettiest method and I'm completely open to suggestions, however, that's the first thing that seems to work for your scenario.

Good luck and if you find this post useful, please give points!

Best regards

-Joe

Tags: Business Intelligence

Similar Questions

  • help create dynamic measures to calculate the total amount in the form of tabluar

    Hello world

    We using apex 4.2 and start re-writing some existing applications originally designed in 3.0.   I was wondering if someone could help me with the following scenario.

    I have a tabular presentation several recording based on a collection called "species_collection".  The form allows fisherman to create an electronic ticket which contains one species, quantity, price, total of the amounts and other descriptive information on the species.  I created a dynamic action (with lots of help from this forum) to automatically update the collection when a field is changed.

    I am now in the hope of creating a dynamic action that will automatically do the following:

    • When the quantity is changed, recalculate the total of the amounts as quantity * price
    • When the price is changed, recalculate the total of the amounts as quantity * price
    • When dollars changed, recalculate the $ amount/total price.
    • When the total amount is changed, recalculate the OVERALL TOTAL

    Currently, I use embedded calls to javascript and then to application processes... but they are difficult to debug, and it seems that dynamic action could be cleaner and simpler.

    the current request is (I've included the concerned fields because it is an important application):

    SELECT
    apex_item.text(1,seq_id,'','','id="f01_'||seq_id,'','') "DeleteRow",
    seq_id,
    seq_id display_seq_id,
    .....
    apex_item.text(10,TO_NUMBER(c010),5,null, 'onchange="setTotal('||seq_id||')"','f10_'||seq_id,'') Quantity,
     
    apex_item.text(11,TO_NUMBER(c011),5,null,'onchange="getPriceBoundaries('||seq_id||')"','f11_'||seq_id,'') Price,
    
    apex_item.text(12, TO_NUMBER(c012),5,null, 'onchange="changePrice
    ('||seq_id||')" onKeyDown="selectDollarsFocus('||seq_id||',event);"','f12_'||seq_id,'') Dollars
     ......
    from apex_collections
     where collection_name = 'SPECIES_COLLECTION' order by seq_id 
    

    each field, QUANTITY, PRICE, $ has an ONCHANGE that then call the application processes that update the collection.

    <script language="JavaScript1.1" type="text/javascript">
    
    function setTotal(row)
    {
       //quantity was entered into form, get values
       var price = $x('f11_'+row);
       var total = $x('f12_'+row);
       var quantity = $x('f10_'+row);
       var nquantity = parseFloat(quantity.value);
       var ntotal;
       var nprice;
       nquantity = nquantity.toFixed(3);
       quantity.value = nquantity;
       //if quantity and price both have values calculate total and save
       if(quantity.value > 0 && price.value > 0)
       {
          ntotal = quantity.value * price.value;
          total.value = ntotal.toFixed(2);
       }
       else
       {
             //if quantity and total both have values calculate price and save
          if(quantity.value > 0 && total.value > 0)
          {
             nprice = total.value/quantity.value;
             price.value = nprice.toFixed(6);
             //check to see if the price entered falls within min/max for that species
             var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=PriceBoard',0);
             get.add('SPECIESPRICE',price.value);
             get.add('SEQUENCEID',row);
             gReturn = get.get();
             if ((gReturn == 'Price entered is too high') || (gReturn == 'Price entered is too low')){alert(gReturn);}
          }
          else  if (quantity.value > 0)
                   total.value = '';
                else
                { 
                     total.value = '';
                     quantity.value = '';
                }
       }
      //saveQPD(row);
       setOverallTotal(); 
    }
    function setOverallTotal()
    {
       var total = 0;
       var nTotal;
       for(i=1;i<=rowCount;i++)
       {
          if(parseFloat($x('f12_'+i).value) > 0)
          {
             total = total + parseFloat($x('f12_'+i).value);
          }
       }
       ntotal = total.toFixed(2);
       document.getElementById("P110_TOTAL").value = ntotal;
       var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=nullProcess',0);
       get.add('P110_TOTAL',ntotal);
       gReturn = get.get();
    }
    function getPriceBoundaries(row) 
    {
       //price was entered into form get all values
       var quantity = $x('f10_'+row);
       var price = $x('f11_'+row);
       var total = $x('f12_'+row);
       var ntotal;
       var nquantity;
       var nprice = parseFloat(price.value);
       nprice = nprice.toFixed(6);
       price.value = nprice;
       //check to see if the price entered falls within min/max for that species
       var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=PriceBoard',0);
       get.add('SPECIESPRICE',price.value);
       get.add('SEQUENCEID',row);
       gReturn = get.get();
       if ((gReturn == 'Price entered is too high') || (gReturn == 'Price entered is too low')){alert(gReturn);}
       //if quantity and price both have a value calculate the total
       if(quantity.value > 0 && price.value > 0)
       {
          ntotal = quantity.value * price.value;
          total.value = ntotal.toFixed(2);
       }
       else
       {
          //if total and price both have a value calculate the quantity
          if(total.value > 0 && price.value > 0)
          {
             nquantity = total.value/price.value;
             quantity.value = nquantity.toFixed(3);
          }
          else
          {
             if(price.value > 0)
                  total.value = '';
             else
             {
                  total.value = '';
                  price.value = '';
             }
          }
       }
       saveQPD(row);
       setOverallTotal();
    }
    function saveQPD(row)
    {
       var quantity = $x('f10_'+row).value;
       var price = $x('f11_'+row).value;
       var total = $x('f12_'+row).value;
       //save quantity
       var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=setQuantity',0);
       get.add('SETVALUE',quantity);
       get.add('SEQUENCEID',row);
       gReturn = get.get();
    //   alert(gReturn);
       //save price
       get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=setPrice',0);
       get.add('SETVALUE',price);
       get.add('SEQUENCEID',row);
       gReturn = get.get();
    //   alert(gReturn);
       //save total
       var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=setTotal',0);
       get.add('SETVALUE',total);
       get.add('SEQUENCEID',row);
       gReturn = get.get();
    //   alert(gReturn);
       
    }
    function changePrice(row)
    {
       //total was entered get all rows
       var quantity = $x('f10_'+row);
       var price = $x('f11_'+row);
       var total = $x('f12_'+row);  
       var ntotal = parseFloat(total.value);   
       var nprice;
       var nquantity;
       ntotal = ntotal.toFixed(2);
       total.value = ntotal;
       //if quantity and total were entered calculate price.
       if (quantity.value > 0 && total.value > 0)
       {
          nprice = total.value / quantity.value; 
          price.value = nprice.toFixed(6); 
          var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=PriceBoard',0);
          get.add('SPECIESPRICE',price.value);
          get.add('SEQUENCEID',row);
          gReturn = get.get();
             if ((gReturn == 'Price entered is too high') || (gReturn == 'Price entered is too low')){alert(gReturn);} 
       }
       //if price and total were entered calculate quantity.
       if (price.value > 0 && total.value > 0)
       {
          nquantity = total.value / price.value;  
          quantity.value = nquantity.toFixed(3);
       }
       if (price.value > 0 && quantity.value > 0)
       {
           ntotal = quantity.value * price.value;
           total.value = ntotal.toFixed(2);
       }
     
           
       saveQPD(row);
       setOverallTotal();        
    }
    
    function selectDollarsFocus(pRow,event)
    {
        tabPress = 0;
        KeyCheck(event);
        if($x('f11_'+ pRow))
        {
                if(KeyID == 9)
                {
                    $x('f14_'+ pRow).focus();
                    onFocusAreaFished(pRow);
                    tabPress = 1;
                }
        }
        else
        {
            if($x('f18_'+ pRow))
            {
                    if(KeyID == 9)
                    {
                        $x('f18_'+ pRow).focus();
                        tabPress = 1;
                    }
            }
            else
            {
                if(--pRow <= rowCount)
                    if(KeyID == 9)
                    {
                        $x('f08_'+ pRow).focus();
                        tabPress = 1;
                    }
            }
            
        }
    }
    
    
    
    </script>
    

    I'm not very familiar with javascript... but looks like there must be a simpler way.   Any thoughts on how I could address the issue?   Thank you!

    I have it.  trial and error.

    the DYNAMICS of the evolution of prices and the $ action are now two separate dynamic actions.

    Action DYNAMICS to update the column from the collection is now last... and it seems that everything works... until I have change something again.

    Thanks again for your help.

    Karen

  • Calculate the speed of the target by using photoelectric sensors 2

    I use 2 photoelectric sensors mounted parallel to each other. As the target passes in front of the sensor, the signal of output voltage goes from 0V to 10V. Because I know that the distance between the sensors, I need to use the difference of rise time of the signal between the sensors to calculate speeds. I can do that when I export the data to excel, but I would do it automatically into my LabVIEW code.

    The data of my sensors are the type of waveform. I can extract the waveform (t0, dt, Y) components using 'Get waveform components' and then look for the timestamp for each value using t0, dt and index value. I need to calculate the timestamp of each sensor once the signal passes to 10V (Y = 10V). I can't extract the components of waveform for signals from sensors (seems to only be able to extract the components for a sensor) and once I extracted components, setting up my calculation of the speed. I think I need a case structure to save the timestamp, once the signal hits first 10V (if Y = 10V save timestamp; if Y = 0V continue indexing of values).

    Any suggestions on the extraction of components of form of wave or indexation of values and calculation speed are greatly appreciated! The code I wrote to collect signals is attached.

    Thank you very much

    Alberto M.

    Here is a sample of the signals of the sensor showing the difference of signal rise time.

    1. you must use the finished sample mode and read all samples.  To match what you have, I would use 10 k samples.  That would be 5 seconds worth of data.  This eliminates the need for the while loop and gives you the full waveforms.

    2. just use the base trigger level detection VI (in the Signal Processing-> measures of waveform-> palette of Waveform Monitoring) to get the time for every rising edge.  Then it's a simple subtraction and divide.

    In addition, if you want to make things even easier, you could have used a camera with a meter of A - B.  Then the meter gives you just the time difference directly.

  • Calculate the average value

    the data that I measured changed quickly, so I want to get the average value of the data

    Don't tell me to use mean.vi, I already know.

    and I got an idea that is to add data in a table every time, then the sum of all value data and take the line of result by the number of items

    but I don't know how to do this, anyone can build a simple vi to show me? Thank you

    I enclose my vi that uses mean.vi to the average value of calc, you can remove it and help in your path, thank you!

    Do not add your data in a table that grows forever. What a waste of RAM. To calculate the average, you only need to sum and N.

    Here is a simple code to accumulate the sum of the values in a shift register and divide by the number of add operations.

  • Calculate the intensity calculation of labview code

    How to calculate the intensity calculation of an in terms of no. labview code. operations? Also please guide me how to find the number of fixed and floating point indicates the operations.

    Thank you

    As far as I know, there is no tool to explicitly measure the number of operations performed under the hood. An option that could give you a more general overview of the complexity of your code using the VI Analyzer Toolkit. There are many tests that may give you some guidance on performance issues. I would check these items:

    http://www.NI.com/white-paper/3588/en/

    http://zone.NI.com/reference/en-XX/help/371361K-01/lvvianalyzerhelp/complexity_metrics_tests/

    http://zone.NI.com/reference/en-XX/help/371361K-01/lvvianalyzerhelp/vi_metrics_tests/

  • modeling of the RPD

    Hello

    I had a question about the modeling of the RPD.

    I had two facts F1, F2 and Dimensions D1, D2, D3

    F1 has joined D1, D2, D3

    F2 joined in the D1.

    So I did as in physical and logical layer joins and I kept F2 level Total of D2, D3.

    So far, it works very well with the measures and dimesions(F1,F2,D1,D2,D3). But my problem is that I have an attribute in F1. As soon as I put this attribute with F1, F2, D1, D2, D3 F1... F2 measurement will be void.

    I know a solution that I can make aliases of F1 and self join with F1 and bring this attribute... But who will create the additional join I want that... Is there an alternative?

    Thank you

    Rahul

    First of all you are not supposed to have an attribute in F1!

    Why? Because you set the level of content on F1 to have F1 values when using D2 and D3 (not the consistent dimension D1).

    If you don't think you need to do the same thing for the F1 F2-related attribute?

    The conclusion is that you've got: F1 does not have any attribute, because it is a fact table, it go out in a dimension and define the level of content.

    Create the additional join I want

    You don't have to pay for every single join, so there is no reason to "do not want" a join because this is how the tool works.

  • Calculate the hours between 2 business days

    Hi all

    Do a complex calculation on the days I do not know how to achieve this.

    Here is my case:

    I have a week of work with hours of work.

    Then there's this delivery time sheet for how long should be set an order ready to be delivered:

    Order1: max 5 hours of work

    Order2: max 8 working hours

    Order3: max 16 hours of work

    When an order is placed, the time of the order is recorded, and when an order has been set in ready to be delivered, this time is also registered.

    How to calculate the time difference between the time where an order has been placed and the time where the order has been on loan. Thereby also taking into account the working days and hours of work.

    Example: type order1 order was placed Tuesday at 15:00.

    Order has been fixed loan Wednesday at 14:00

    This means that to fix this ready order lasts 7 hours, which means that it is 2 hours time.

    CREATE TABLE REF_WORKDAYS
      (
        
        "WERKDAG"       VARCHAR2(15 ) NOT NULL ENABLE,
        "SOORT_WERKDAG" VARCHAR2(15 ) NOT NULL ENABLE,
        "BEGIN_TIJD"    VARCHAR2(10 ) NOT NULL ENABLE,
        "EIND_TIJD"     VARCHAR2(10 B) NOT NULL ENABLE,
        
      )
    

    Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Monday','WORKINGDAY','08:00','16:00');
    Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Tuesday','WORKINGDAY','08:00','16:00');
    Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Wednesday','WORKINGDAY','08:00','16:00');
    Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Thursday','WORKINGDAY','08:00','16:00');
    Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Friday','WORKINGDAY','08:00','16:00');
    Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Satrurday','WORKINGDAY','08:00','14:00');
    Insert into REF_WORKDAYS (WERKDAG,SOORT_WERKDAG,BEGIN_TIJD,EIND_TIJD) values ('Sunday','NOT-WORKINGDAY','08:00','16:00');
    
    COMMIT;
    

    create table glas_order
    
    (order_id number
    , order_desc varchar2(100) not null
    , order_type varchar2(10) not null
    , order_date date not null
    , order_ready date
    
    );
    

    Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (1,'order bla','Order1',to_date('07-APR-15 09:00','DD-MON-RR HH24:MI'),to_date('08-APR-15 12:00','DD-MON-RR HH24:MI'));
    Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (2,'order nice','Order1',to_date('14-APR-15 10:00','DD-MON-RR HH24:MI'),to_date('16-APR-15 16:00','DD-MON-RR HH24:MI'));
    Insert into GLAS_ORDER (ORDER_ID,ORDER_DESC,ORDER_TYPE,ORDER_DATE,ORDER_READY) values (3,'order ugly','Order2',to_date('18-APR-15 13:00','DD-MON-RR HH24:MI'),to_date('21-APR-15 09:00','DD-MON-RR HH24:MI'));
    
    COMMIT;
    

    Thank you

    Diana

    Select

    I like order_id

    such as length d

    order_type

    d decode(order_type,'Order1',5,'Order2',8)

    overtime

    of glas_order o

    model

    Reference r on

    (select

    WERKDAG w

    begin_tijd b

    e eind_tijd

    , (to_date (eind_tijd, 'HH24') - to_date (begin_tijd, 'HH24')) * 24 hard

    of ref_workdays

    where soort_werkdag = "WORKINGDAY")

    dimension (w)

    measures (b, e, hard)

    main m

    partition of (order_id I)

    size of (0 n)

    measures (0d, order_date, order_ready, cast (null as varchar2 (10)) as wday, order_type)

    iterate (1e6) rules until (iteration_number > = trunc(order_ready[0]) - trunc(order_date[0])))

    WDAY [0] = to_char (order_date [0] + iteration_number, 'FMDay', 'NLS_DATE_LANGUAGE = ENGLISH')

    , d [0] = d [0] +.

    case

    When trunc(order_date[0]) = trunc(order_ready[0]) - beginning and ready same day

    then presentv (r.b [wday [0]],)

    less (largest (order_ready [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')), to_date (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))

    -bigger (to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI'), least (order_date [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))))

    0) * 24

    When order_date [0] + iteration_number = order_date [0] - first day

    then presentv (r.b [wday [0]],)

    TO_DATE (to_char (order_date [0], 'YYYYMMDD') | r.e [WDAY [0]], 'YYYYMMDDHH24:MI')

    -bigger (order_date [0], to_date (to_char (order_date [0], 'YYYYMMDD') | r.b [WDAY [0]],'YYYYMMDDHH24:mi'))))

    0) * 24

    When trunc(order_date[0]) + iteration_number = trunc(order_ready[0]) - last day

    then presentv (r.b [wday [0]],)

    less (order_ready [0], to_date (to_char (order_ready [0], 'YYYYMMDD') | r.e [WDAY [0]],'YYYYMMDDHH24:mi'))))

    -to_date (to_char (order_ready [0], 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')

    0) * 24

    of another nvl (r.dur [wday [0]], 0)

    end

    )

    ORDER_ID DURATION ORDER_TYPE OVERTIME
    1 11 Order1 6
    2 22 Order1 17
    3 10 Order2 2

    Rewrittten party rules for readability purposes (more resources)

    measures (0d, order_date, order_ready, cast (null as varchar2 (10)) as to_date (null), (null) to_date, bd, order_type, wday ed)

    iterate (1e6) rules until (iteration_number > = trunc(order_ready[0]) - trunc(order_date[0])))

    WDAY [0] = to_char (order_date [0] + iteration_number, 'FMDay', 'NLS_DATE_LANGUAGE = ENGLISH')

    , comics [0] = to_date (to_char (order_date [0] + iteration_number, 'YYYYMMDD') | r.b [WDAY [0]], 'YYYYMMDDHH24:MI')

    , ed [0] = to_date (to_char (order_date [0] + iteration_number, 'YYYYMMDD') | r.e [WDAY [0]], 'YYYYMMDDHH24:MI')

    , d [0] = d [0] +.

    case

    When trunc(order_date[0]) = trunc(order_ready[0]) - beginning and ready same day

    then presentv (r.b [wday [0]],)

    less (largest (order_ready [0], [0] bd), ed [0])

    -Greatest (BD [0], least(ORDER_DATE[0],ED[0]))

    0) * 24

    When order_date [0] + iteration_number = order_date [0] - first day

    then presentv (r.b [wday [0]],)

    ED [0]

    -Greatest(ORDER_DATE[0],BD[0])

    0) * 24

    When trunc(order_date[0]) + iteration_number = trunc(order_ready[0]) - last day

    then presentv (r.b [wday [0]],)

    least(order_ready[0],ED[0])

    -bd [0]

    0) * 24

    of another nvl (r.dur [wday [0]], 0)

    end

    )

    Jubilee should be Saturday I guessed.

  • Calculate the use of operating rooms

    I received this question in an e-mail.

    I will post it here, as well as my own answer-, so that other people with the same problem can find and learn, and that responses can be given (here there are smart people who might have alternative solutions of large .)

    Here's the post with the question:

    ------------------------------------------

    Hi Kim,

    I'm stuck in a SQL query.

    I want to calculate the use of operating rooms. follwing is my data structure

    create the table room_usage
    (in_time DATE,
    out_time DATE,
    mr_no VARCHAR2 (15).
    room_no, NUMBER (3));

    insert into room_usage
    values
    (to_date('11-Feb-15 8:33:00 AM', 'dd-mon-rr hh:mi:ss am'),
    to_date('11-Feb-15 10:17:00 AM', 'dd-mon-RR hh:mi:SS am'),
    '00052740',
    733);
    insert into room_usage
    values
    (to_date('11-Feb-15 10:56:00 AM', 'dd-mon-rr hh:mi:ss am'),
    to_date('11-Feb-15 12:36:00', 'dd-mon-RR hh:mi:SS am'),
    '00111780',
    733);
    insert into room_usage
    values
    (to_date('11-Feb-15 12:56:00 PM', 'dd-mon-rr hh:mi:ss am'),
    to_date('11-Feb-15 2:46:00 PM', 'dd-mon-RR hh:mi:SS am'),
    '00111777',
    733);
    insert into room_usage
    values
    (to_date('11-Feb-15 3:02:00 PM', 'dd-mon-rr hh:mi:ss am'),
    to_date('11-Feb-15 6:12:00 PM', 'dd-mon-RR hh:mi:SS am'),
    '00052713',
    733);
    insert into room_usage
    values
    (to_date('11-Feb-15 6:51:00 PM', 'dd-mon-rr hh:mi:ss am'),
    to_date('11-Feb-15 7:57:00 PM', 'dd-mon-RR hh:mi:SS am'),
    '00052760',
    733);
    insert into room_usage
    values
    (to_date('12-Feb-15 8:51:00 PM', 'dd-mon-rr hh:mi:ss am'),
    to_date('12-Feb-15 9:57:00 PM', 'dd-mon-RR hh:mi:SS am'),
    '00082760',
    733);

    Select IN_TIME, OUT_TIME, (OUT_TIME - IN_TIME) * 24 * 60 stay, MR_NO, ROOM_NO
    of room_usage
    When trunc (IN_TIME) between February 11, 15 'and 12 February 15'
    order of in_time


    in_time out_time stay_min mr_no room_no

    11 February 15 08:33 11 February 15 10:17 104 00052740 733
    11 February 15 10:56 11 February 15 12:36 100 00111780 733
    11 February 15 12:56 11 February 15 14:46 110 00111777 733
    11 February 15 15:02 11 February 15 18:12 190 00052713 733
    11 February 15 18:51 11 February 15 19:57 00052760 733
    12 February 15 20:51 12 February 15 21:57 00082760 733

    But I also want to get time slots to USE NOT. This is the result I want

    in_time out_time stay_min mr_no room_no

    11 February 15 12:01:00 AM February 11, 15 08:32 511 no use of 733
    11 February 15 08:33 11 February 15 10:17 104 00052740 733
    11 February 15 10:18 11 February 15 10:55 37 no use of 733
    11 February 15 10:56 11 February 15 12:36 100 00111780 733
    11 February 15 12:37 February 11, 15 12:55 18 no use of 733
    11 February 15 12:56 11 February 15 14:46 110 00111777 733
    11 February 15 14:47 11 February 15 15:01 14 no use of 733
    11 February 15 15:02 11 February 15 18:12 190 00052713 733
    11 February 15 18:13 February 11, 15 18:50 37 no use of 733
    11 February 15 18:51 11 February 15 19:57 00052760 733
    11 February 15 19:58 11 February 15 23:59 241 no use of 733

    How can I get that.

    A problem like this is easy to solve with the model clause:

    Select in_time, out_time, round ((out_time-in_time) * 24 * 60) stay_min, mr_no, room_no
    of room_usage
    model
    partition (room_no, trunc (in_time) d)
    dimension (row_number() on rn (partition room_no, trunc (in_time) order of in_time))
    measures (in_time, out_time, mr_no)
    rules iterate (1000) until (presentv (in_time [iteration_number + 1], 1, 2) = 2)
    (in_time [iteration_number + 0.5] = presentv (out_time [iteration_number], [iteration_number] out_time, trunc (in_time [iteration_number + 1])) + interval minute '1'
    , out_time [iteration_number + 0.5] = presentv (in_time [iteration_number + 1], in_time [iteration_number + 1], trunc (out_time [iteration_number] + 1))-'1' minute of interval
    , mr_no [iteration_number + 0.5] = 'no use '.
    )
    order of in_time

  • How to calculate the IOPS datastore / s and latency via Powercli?

    Hi all!

    I want to calculate the IOPS / s (RO/RW) and the latency of the data via Powercli store, but I cant' find this metric in Vcenter (in the data store tab) and see no metric for data via the cmdlet Get-Stat store.

    How can we measure IOPS / s and latency of data store?  For example I know veeam monitor this information - http://cdn.swcdn.net/creative/v16.8/images/screenshots/products/VM/Lg/EN/VMan60-Orion-Datastore-Top_Lg_960x540.jpg

    I know, I can get this VM or vmhost metric, but I need information on the data store.

    How to measure for IOPS / s and latency of data properly store?

    Thanks in advance!

    These measures are collected on ESXi nodes, entity would need to have the ESXi nodes where these data warehouses are connected.

    You can use the Instance property to filter.

    Under the PerformanceManager , you see all the measures for each indicator it indicates under which entity this metric is collected.

    And Yes, the cmdlet Get-inventory returns no data warehouses.

    There is a little, aggregated metric for data warehouses, I'll have to find an alternative for those.

    Nice catch!

  • How to calculate the CPU Ready on Cluster DRS via Powercli?

    Hi all!

    I have a DRS Vsphere cluster. I want to know what is the value of the loan of CPU I have in my group.

    For example, I get 20% of powercli value, it is normal for the cluster, but if I have 100% or more, I have a problem.

    How to achieve via Powercli? And how to calculate the percentage values correctly?

    I know, I can get all values of CPU Ready of VMs cluster, but IT is not the same thing, I need overall value of CPU Ready.

    Thanks in advance!

    As far as I know you can get the cpu.ready.summation for ESXi nodes or VMs.

    For a cluster, you will need to get the value of each node in the cluster ESXi and then take the average.

    The metric cpu.radey.summation is expressed in milliseconds.

    To get a percentage, you need to calculate the percentage of loan period during the interval during which it was measured.

    Something like this (this will give the loan current %)

    $clusterName = "mycluster.

    $stat = "cpu.ready.summation".

    $esx = get-Cluster-name $clusterName | Get-VMHost

    $stats = get-Stat-entity $esx - Stat $stat - Realtime - MaxSamples 1 - forum «»

    $readyAvg = $stats | Measure-object-property - average value. Select - ExpandProperty average

    $readyPerc = $readyAvg / ($stats [0].) IntervalSecs * 1000)

    Write-Output "Cluster $($clusterName) - CPU % loan $(' {0:p}'-f $readyPerc).

  • Open SPR 'Read Only' - good way to open the RPD?

    Whenever I try to open a SPR I've locally saved on my desktop, it says "This RPD can be opened read-only"

    I have the server upward and the race, and I go to admin-> copy-> tool save to my local office

    I go to the real server box to get a copy of the RPD, if I want to open it offline to change?

    What are the measures?

    Thank you

    try to put this file is one another location other than the desktop, for example: D:, then open

  • How can I calculate the total time in java?

    Hello!

    I need to calculate the total time!

    For example I start time:
    Format formatter1;
    Date date1 = new Date();
    formatter1 = new SimpleDateFormat("hh:mm:ss");
    Dim startTime = formatter1.format (date1);
    startTime = "14:20:40.

    And I have finishing time:
    Format formatter2;
    Date2 date = new Date();
    formatter2 = new SimpleDateFormat("hh:mm:ss");
    String finishTime = formatter2.format (date2);
    finishTime = '08:30:55;



    Also, having calculated manually, I get the total time: '18:10:15.

    How can I calculate the total time in java? (Using formatter1 and formatter2 I guess)

    What I need is to print 'total 18:10:15 '.

    Thank you!

    800512 wrote:
    I did the following, but I think something's wrong here:

    I've defined before: Date date1 = new Date(); Date2 date = new Date();
    And it should be exactly 5 seconds between them.

    I found the delta between date1 and date2:

    Format formatter = new SimpleDateFormat("HH:mm:ss");
    timeInMilliFromStart long = date1.getTime () - date2.getTime ();
    Date date3 = new Date (timeInMilliFromStart);
    String timeInSecFromStart = formatter.format (date3);

    and I still get
    timeInSecFromStart = 02:00:05

    But it should be exactly 00:00:05.

    What is a problem?

    Because, as I said, a Date to measure a moment in time, not a period. So when you have 5000 ms, and you that transform a Date, this means that 5 seconds after the time, which equals 00:00:05.000 01/01/1970 GMT.

    As I said, if you are not currently in GMT, then you must set the DateFormat GMT TZ. Right now, it's to show you the time in your TZ. If you have included the date in your SimpleDateFormat, you would see the 01/01/1970 or 31/12/1969, function that TZ you find.

    Bottom line: you try to use these classes in a sense they are not intended for, and while you can get the results you want for a limited set of entries if you understand how these classes and how to work with it, it is a fragile approach and comes with all sorts of warnings warning.

  • How to calculate the only selected hierarchy

    Hello

    I have the simple application of planning (11.1.2 Hyperion) with all the required dimensions.

    * Dimension 'Entity' looks like this: *.
    COMPANY_1
    COSTCENTRE_1_1
    PRODUCTIONLINE_1_1_1
    PRODUCTIONLINE_1_1_2
    PRODUCTIONLINE_1_1_3
    COSTCENTRE_1_2
    PRODUCTIONLINE_1_2_1
    PRODUCTIONLINE_1_2_2
    COSTCENTRE_1_3
    PRODUCTIONLINE_1_3_1
    PRODUCTIONLINE_1_3_2
    COMPANY_2
    COSTCENTRE_2_1
    PRODUCTIONLINE_2_1_1
    PRODUCTIONLINE_2_1_2
    PRODUCTIONLINE_2_1_3
    COSTCENTRE_2_2
    PRODUCTIONLINE_2_2_1
    PRODUCTIONLINE_2_2_2
    COSTCENTRE_2_3
    PRODUCTIONLINE_2_3_1
    PRODUCTIONLINE_2_3_2

    Users of COMPANY_1 and COMPANY_2 import data in essabase (Level0 members) using the Regional service. Separately for each company and at different times.

    My problem is:_
    Now, I am preparing the calculation script which should calculate all 'measures' and global entities data for a selected hierarchy (COMPANY_1 or COMPANY_2).

    Something like this (but this is not supported in essbase (11.1.2)):
    DIFFICULTY ('January', 'Local', 'HSP_InputValue', "FY11", "SOHC", "VCurrentApproved", *@IRDESCENDANTS("COMPANY_1") *)
    DIM CALC ('Measure', * 'Entity' *);
    ENDFIX

    Thanks for all the inspiration.
    Vladislav

    Hello
    Change your business as a rule below and have your users to run the calculation of planning. Assuming they have access to their entities only, they will be able to select their entities only and this should include only the selected feature:

    DIFFICULTY ('January', 'Local', 'HSP_InputValue', "FY11", "SOHC", "VCurrentApproved", @RELATIVE({COMPANY},0))
    CALC DIM ("measure");
    ENDFIX

    DIFFICULTY ('January', 'Local', 'HSP_InputValue', 'FY11', 'SAct', 'VCurrentApproved')
    @IDESCENDANTS ({COMPANY});
    ENDFIX

    See you soon,.
    Alp

  • script to calculate the hypotenuse of a page and place an image block

    Hello

    I wonder if anyone can help me with a script.

    We need to get the size of an open document, calculate the hypotenuse (visible diagonal), it divides by 10 and place a picture box square on the page to this size in the upper left corner.

    I found this javascript to calculate the hypotenuse but don't know how to use it or integrate it.

    function hypotenuse (a, b) {}

    function square (x) {return x * x ;}

    Return Math.sqrt ((a) square + square (b));

    }

    function secondFunction() {}

    var result;

    result = hypotenuse (1,2);

    alert (result);

    }

    Yes, I am a total newbie and would appreciate anyones help.

    Thank you

    maxrus2012

    Hi maxrus,

    It seems so simple that anyone was necessary to answer you! Indeed, we can easily retrieve the height and width of a page, then calculate the diagonal, then create a square based on this length.

    In any case, let's try to do this routine work in any context, supporting all units of measure custom, parameters of leaders, spreads rotated and/or same scaling / biased pages! To do this, avoid common methods from "geometric limits." Interesting challenge!

    Here is my attempt:

    // Create a square based on the active page's diagonal length (10%)
    // ===========================
    
    function measureDiagonal(/*Page*/page)
    // -------------------------------------
    // Ret. the page's diagonal in pts (relative to the page CS)
    {
        var CS_INNER = CoordinateSpaces.innerCoordinates;
    
        var wh = page.resolve(AnchorPoint.bottomRightAnchor, CS_INNER)[0],
            w = wh[0],
            h = wh[1];
    
        return Math.sqrt(w*w + h*h); // Pythagorean theorem
    }
    
    function createTopLeftCornerRectangle(/*Page*/page, /*num[2]*/wh)
    // -------------------------------------
    // wh: width and height of the rectangle in pts (relative to the page CS)
    {
        // Some const shortcuts
        // ---
        var    CS_SPREAD = CoordinateSpaces.spreadCoordinates,
            CS_INNER = CoordinateSpaces.innerCoordinates,
            RM_REPLACE = ResizeMethods.replacingCurrentDimensionsWith,
            AP_TOP_LEFT = AnchorPoint.topLeftAnchor;
    
        var spread = page.parent,
            // Create a rectangle (in the spread CS--the page CS is not relevant yet)
            // ---
            rec = spread.rectangles.add({fillColor:'Black'}),
            // Page transformation values (relative to the spread)
            // ---
            pageMxValues = page.transformValuesOf(CS_SPREAD)[0].matrixValues;
    
        // Normalize the rectangle in the spread
        // (the size does not matter here)
        // ---
        rec.reframe(CS_SPREAD, [[0,0],[10,10]]);
    
        // Apply the page transfo to the rectangle
        // so that its inner space fits the page space
        // ---
        rec.transform(CS_SPREAD, [[0,0], CS_SPREAD], pageMxValues);
    
        // Finally, resize the rec
        // ---
        rec.resize(CS_INNER, AP_TOP_LEFT, RM_REPLACE, wh.concat(CS_INNER));
    
        return rec;
    }
    
    var    FACTOR = .1, // 10%
        win = app.layoutWindows.length && app.activeWindow,
        page = win && (win instanceof LayoutWindow) && win.activePage,
        size = page && page.isValid && FACTOR*measureDiagonal(page);
    
    size && createTopLeftCornerRectangle(page, [size,size]);
    

    Not sure that's exactly what you're looking for.

    In any case...

    @+

    Marc

  • How to calculate the size of index?

    How to calculate the size of indexes for a small relational database. Please make it clear that I understand.

    Hello

    How to measure size.

    View DBA_SEGMENTS gives the size of all the Segments (Table, Index,...).

    If you can for example use a query like this:

    select segment_name, bytes "Size in Bytes"
    from dba_segments
    where owner = ''
    and segment_name = ''
    and segment_type = 'INDEX'
    

    Hope this helps.
    Best regards
    Jean Valentine

Maybe you are looking for

  • HDV MiniDV player

    I have lost my HDR - HC9 HDV MiniDV camera and replaced with the HDR-CX550V. That leaves me with a bunch of records on MiniDV cassettes with nothing to play these, or convert them to computer. I watched some MiniDV players, but these were generally t

  • Z580 Driver TouchPad Win8

    Hello I have improved the system to Windows 8, including many errors with Werfault.exe I have problem with the Touchpad. I downloaded the new driver page driver/support here, but again there is a note that it is for the system 64-bit / 32-bit, I can

  • Attachment problem Lenovo A850

    Hi, I am not able to get the Hotspot works fine on my A850. My mobile devices (laptop, Tablet and mobile phone) are able to connect to my SSID of Hotspot A850 but can't access internet. No proxy has been on mobile devices. I am able to access interne

  • Where can I find the hexadecimal encryption for the router?

    original title: WIRELESS IS ASKING for HEX ENCRYPTION WHERE I would NORMALLY PUT the PASSWORD My toshiba satellite pro 4600 when I entered the password, he said I was connected but didn't have no internet.  the signal strength is good... and the rest

  • How can I check the solidity of the Acer Crystal Eye laptop builtin camera

    camera I have laptop Acer model ASPIRE 6530.  In Skype talk, video has failed.  I'm able to run video calls, probably because of problem with my computer laptop builtin camera Crystal Eye.  I've updated my version of Skype 5.3 as suggested by a frien