Applying rounding function to entire channel

I have a channel in DIAdem with a large amount of values (36,000,000)  the values contain about 13 decimal places.
I would like to round the value off to about 4 or 5 decimal places max.  
Can someone help me figure out how to do this in DIAdem.
Example:
0.3784729837492 ->0.37847 
I want do do this for every value in the channel. 
can someone help me figure out how to do this? 
Thanks in advance,
Tom 
Solved!
Go to Solution.

Hi Tom,
You can utilize the VBScript function, Round(value, number of decimal places).  I wrote a quick script in DIAdem which performs this operation on a numeric channel, named dataChannel, and transfers the truncated values a new channel, named truncChannel.
Dim toBeTrunc, i
For i = 1 To Data.Root.ChannelGroups(1).Channels("dataChannel").Properties("length").Value
     toBeTrunc = Data.Root.ChannelGroups(1).Channels("dataChannel").Values(i)
     Data.Root.ChannelGroups(1).Channels("truncChannel").Values(i) = Round(toBeTrunc,3)
Next
I hope this helps.
Warm Regards,
Daniel D.
National Instruments
Automated Test Software R&D

Similar Messages

  • Using sum function and round function in single text form field

    Hi all,
    I have a column Name - A . In the rtf template i have summed up the column A and showing it. But the output is coming as 99.9999997. I want to round it to 100.
    I tried using <?round(sum(A),2)?> but dint workout.
    I also tried using variables. It is also not working.. I used <?xdoxslt:set_variable($_XDOCTX,’ABS',sum(A)?> and then i used get variable to get it.... But it throwing error while using sum in the set variable step.
    Can anyone please help me..
    Thanks
    Sunil

    Hi Sunil,
    Calculate the sum into a Variable. and apply round function on the variable to get the desired value.
    Calculating sum:
    <?xdoxslt:set_variable($_XDOCTX,'v',xdoxslt:get_variable($_XDOCTX,'v')+DOLLARS)?> (its running sum formula,should be placed inside the table to get sum of all rows of particular column)
    here Variable 'v' holds the sum value
    apply round function:
    <?round(xdoxslt:get_variable($_XDOCTX,'v'))?>
    Thanks and Regards,
    Aravind

  • Issues with 'Rounding' function (Word 2007 issue? Works in Word 2003...)

    My colleague (using Word 2003) and I (using Word 2007) are working on a change to a template where we include a formula that has the function called rounding.
    She (2003) is able to preview the pdf but I (2007) am getting error message: : oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'round'
    All other settings that we have appear to be the same (same config file, same java version, etc)
    Does anyone know if there are some changes to Word 2007 that are causing this? And, any ideas on how to resolve?
    Thanks for the help!
    Background:
    -The function is designed provide a total weight value: each individual weight value, multiply by a factor of .80, round up, and then added together to get a total amount.
    -Because we also show the individual weight values on the output, (also multiplied by the factor of .80 and then rounded up), we need the factor and rounding to happen before the sum).
    The entire set of functions for the total weight value is:
    <?xdoxslt:set_variable($_XDOCTX,'sum',0)?>
    <?for-each:LIST_G_CONTAINER_NAME1?><?for-each:G_CONTAINER_NAME1?>
    <?xdoxslt:set_variable($_XDOCTX,'sum', xdoxslt:get_variable($_XDOCTX,'sum')+ xdoxslt:round((GROSS_WT*0.8),2))?><?end for-each?><?end for-each?>
    <?format-number: xdoxslt:get_variable($_XDOCTX,'sum');'9G990D00'?>
    space
    <?WEIGHT_UOM_CODE?>
    Error when attempting to preview the pdf after uploading an xml file:
    : oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'round

    Hi,
    I took my original file (didn't have the round functionality) and Word 2007 and did the following:
    1) Tested with xml to ensure that there are no other issues - was able to preview successfully
    2) Added the function you suggested: <?xdoxslt:round(1000.98978,2)?> and saved the change
    3) Tried to preview using the same xml and got the same error message about rounding
    I can't test on 2003 because my colleague is not working right now (she is the one with that version installed). I will try on 2003 later today (but I am guessing it will work for her because the other rounding function works for her).
    Thanks for any other ideas about this.
    Here is the entire extract of error message:
    Font Dir: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\fonts
    Run XDO Start
    RTFProcessor setLocale: en-us
    RTFProcessor setConfig: C:\Program Files\Oracle\BI Publisher\BI Publisher Desktop\Template Builder for Word\config\xdo.cfg
    FOProcessor setData: C:\Data\BI Publisher\2010_CR-102626_PL-CML_Net Weight\Net Weight Template Changes\Testing\OTST_SC-06_PL_SGS-2903194_Direct_ENG_Jul-09.xml
    FOProcessor setLocale: en-us
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.invokeProcessXSL(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLT10gR1.transform(Unknown Source)
         at oracle.apps.xdo.common.xml.XSLTWrapper.transform(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.fo.util.FOUtility.generateFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.createFO(Unknown Source)
         at oracle.apps.xdo.template.FOProcessor.generate(Unknown Source)
         at RTF2PDF.runRTFto(RTF2PDF.java:632)
         at RTF2PDF.runXDO(RTF2PDF.java:466)
         at RTF2PDF.main(RTF2PDF.java:254)
    Caused by: oracle.xdo.parser.v2.XPathException: Extension function error: Method not found 'round'
         at oracle.xdo.parser.v2.XSLStylesheet.flushErrors(XSLStylesheet.java:1526)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:517)
         at oracle.xdo.parser.v2.XSLStylesheet.execute(XSLStylesheet.java:485)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:264)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:150)
         at oracle.xdo.parser.v2.XSLProcessor.processXSL(XSLProcessor.java:187)
         ... 16 more

  • Issue with ROUND function in RTF template

    Hi All,
    Can anyone please help me in implementing the ROUND function at the RTF template.
    Need to handle rounding of amounts at the RTF template level itself.
    The ROUND function should be implemented to the following tags:
    <?sum(current-group()/TAXABLE_AMOUNT)?> (Record level)
    <?sum(TAXABLE_AMOUNT)?> (Report level total)
    Eg. If the Sum(current-group()/TAXABLE_AMOUNT) for a particular record is 401.65 then it should round of to 402
    we try to do this using following syntax ..
    1) by declaring variable "value"
    <?xdoxslt:set_variable($_XDOCTX, value, sum(current-group()/TAXABLE_AMOUNT))?>
    2) <?xdofx:round(sum(current-group()/TAXABLE_AMOUNT))?>
    3)<?xdofx:round(xdoxslt:sum(current-group()/TAXABLE_AMOUNT))?>
    but we ding get the solution.
    A quick response on this is highly appreciable.
    Thanks,
    Praveen

    Re: Summing derived values within xdofx:
    Re: Rounding not working

  • How would you apply different calibrations to multiple channels

    I'm attempting to apply calibration data to multiple channels. The calibrations could have been done at different times for different channels and could be using different fits. I think I have a solution for just applying the calibration information to one channel. I'm posting the solution for one channel in this post. In the next post I will include the multi-channel problem I'm working on. I had to add txt onto the initial file in order to post this.
    Thanks in advance.
    Solved!
    Go to Solution.
    Attachments:
    Apply Calibration One Channel.vi ‏138 KB
    Initial.txt ‏1 KB

    Thanks for the links John. I just logged on to post my working solution so I haven’t had a chance to look at them yet.
    I’ve been working on this problem and have come up with the below attachment. I believe the logic is correct, but do not know if this is the most efficient way of doing this. I start by reading the calibration information in my ini file for only the channels that I am collecting data for. This is accomplished by the case structure enclosed in the for loop. The calibration values are stored as variables so I don’t have to read them with each data point I collect. I then start the data collection within my while loop. As I collect the data I pass it through a for loop where I apply the calibration curve to it and pull the calibration variables from the 2nd case structure. I’m using a for loop for this so I can index the wave files and apply the correct calibration information to each one. The channels and sections will be inputs to this vi from the choose channel vi.
    John I don’t know if this is better or worse than what you are suggesting. I will read the links you sent me.
    Does anybody have any comments on what I’ve put together?
    Thanks, Eric
    Attachments:
    Acquire and Transform Data.vi ‏209 KB

  • Problem with the round function using Date

    Hi,
    I have a problem with round function for Date. The input is the four digit year which was picked out from say SYSDATE.
    In these scenarios the original value should be rounded up and should get the output as shown under rounded column.
    Scenario1
    Original Rounded
    2020 ---> 2020
    2021 ---> 2020
    2022 ---> 2020
    2023 ---> 2020
    2024 ---> 2020
    2025 ---> 2025
    2026 ---> 2025
    Scenario2
    Original Rounded
    2020 ---> 2020
    2021 ---> 2025
    2022 ---> 2025
    2023 ---> 2025
    2024 ---> 2025
    2025 ---> 2030
    2026 ---> 2030
    Scenario3
    Original Rounded
    2020 ---> 2020
    2021 ---> 2020
    2022 ---> 2020
    2023 ---> 2025
    2024 ---> 2025
    2025 ---> 2025
    2026 ---> 2025
    Can anyone help with this....Urgent Please
    Thanx for your time

    1.
    SQL> select n,n-mod(n,5) rnd from test;
             N        RND
          2020       2020
          2021       2020
          2022       2020
          2023       2020
          2024       2020
          2025       2025
          2026       2025
    2.
    SQL> select n,n+(case when mod(n,10) = 0 then 0
      2                   when mod(n,10) < 5 then 5-mod(n,5)
      3                   else 10-mod(n,10)
      4              end) rnd
      5  from test;
             N        RND
          2020       2020
          2021       2025
          2022       2025
          2023       2025
          2024       2025
          2025       2030
          2026       2030
    7 rows selected.
    3.
    SQL> select n,n+(case when mod(n,10) < 3 then mod(n,10)*-1
      2                   when mod(n,10) < 8 then 5-mod(n,10)
      3                   else 10-mod(n,10)
      4              end) rnd
      5  from test;
             N        RND
          2020       2020
          2021       2020
          2022       2020
          2023       2025
          2024       2025
          2025       2025
          2026       2025
          2027       2025
          2028       2030
          2029       2030
          2030       2030
    11 rows selected.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Why can I not use the channel name, which is obtained from the function of DAQmx Task, as the input of the channel name for the function of Get Channel Information of DAQ?

    Not a lot of details here, but my guess is this isn't working for you because you are wiring in the task to the Active Channels Property and not the actual Channel Name. I have attatched a screenshot of what I believe you are trying to do. The Task has 2 channels in it, so I need to index off one of the channels and wire it into the active channels input of the Channel Property node. Then I can read information about that channel
    Attachments:
    channel_name.JPG ‏69 KB

  • Apply Oracle Functions to Individual numeric characters in a string

    I'm trying to apply MOD function and some arithmetic to each and every numeric character with-in a string. Maximum length of the string is 30 characters, and its variable length. When I try the traditional for loop, my execution time increases drastically. Here are some details:
    If my string is: abc1234X-23J, I need to keep the alphabets and special characters as is, multiply each numeric by 5 add 3, apply a MOD of 10. I've done this in a function like this:
    CREATE OR REPLACE FUNCTION Test1(i_Text IN VARCHAR2) RETURN VARCHAR2 IS
    V_Output VARCHAR2(30) := '';
    BEGIN
    FOR I IN 1 .. LENGTH(i_Text) LOOP
    IF SUBSTR(i_Text, I, 1) IN ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9') THEN
    V_Output := V_Output || TO_CHAR(MOD((TO_NUMBER(SUBSTR(i_Text, I, 1)) * 5) + 3, 10));
    ELSE
    V_Output := V_Output ||SUBSTR(i_Text, I, 1);
    END IF;
    END LOOP;
    RETURN V_Output;
    EXCEPTION WHEN OTHERS
    RETURN NULL;
    END;
    I need to apply this function to approximately. 4 columns, data volume is huge. I tried with 2.5 M records, in INSERT ... SELECT option, it takes 17 seconds without this function and around 6 minutes when I use this function. This is just a sample data, I would like this task to be completed with-in 30 seconds. Is there any way I can change my function or use any other option to get better performance?
    Note: I tried REGEXP_REPLACE - this didnt help me, increased my execution time - I had to use native dynamic sql in this case
    Tried with decode - this also didnt help.
    Any expert advice is appreciated.
    Thanks in advance.

    SQL> select mod((l*5)+3,10), l from (select level - 1 l from dual connect by level <= 10);
    MOD((L*5)+3,10)          L
                  3          0
                  8          1
                  3          2
                  8          3
                  3          4
                  8          5
                  3          6
                  8          7
                  3          8
                  8          9
    SQL> select translate('abc1234X-23J,','0123456789','3838383838') FROM DUAL;
    TRANSLATE('AB
    abc8383X-38J,Hope this helps
    cheers
    Raj
    Message was edited by: code formatting applied
    s.rajaram

  • Combing rounding functions with other functions

    I am using hyperion reports. Is it possible to combine a rounding function with another function? Specifically, I am taking a variance of actual vs budget where actual and budget are % of total functions. The variance I am getting is off (see ex. below.) I need to keep the actual and budget at 1 decimal point. To correct this problem in excel I am able to round the numbers pulled in by essbase. The ex. below illustrates my problem. Actual .2% Budget .2% Variance .1%

    You may want to make a 'Scenario' for rounding that is rounding the input data. If you make it (variance) 2pass, it will show the difference of the rounded numbers (ie. 0%)Rich [email protected]

  • Native compilation and the ROUND function

    Native Compilation Advisor lists the built-in ROUND function as not supported for natively compiled stored procedures.  Is there a suggested workaround?

    oracle by oracle  wrote:
    I am trying to test performance of one package and there is only one procedure wich uses just instr and substr internal functions ( I am working with varchar2).
    I am having the folowing results: native compilation is twice worst than inetrpreted. What may be the reason?
    P.S. I did ALTER SYSTEM FLUSH SHARED_POOL;Yuo should take this into account that the Native compilation is not supposed to make the code always go faster. If I remember correctly, the maximum benefit that Oracle benchmarked for it was about 30% only and taht too, if the code has lots of computational code rather than queries. If your package contains lots of this kind of code. than may be the Native compilation may be faster than the other but it doesn't come with any guarantee like this.
    Have a read about it from here,
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/tuning.htm#sthref2278
    HTH
    Aman....

  • Round functions in SAP

    Hi Experts,
    Can you help me in finding a suitable round function in SAP? I need to round off to 3 decimal places. I used the function module ROUND but it is not very much helpful.
    I have 3 values ex 0.43444567 , 0.0824495 , 0.48310483. The total is 1. But wen i update in transaction Kp46 for Plan value column it takes only 3 decimal places. So if i reduce the above 3 values to 0.434,0.082,0.483 then i get total as 0.999.
    But if i reduce them ( rounding off ) to 0.435,0.083,0.483 i get 1.001. Please help me get a proper solution for this.
    Thanks and Regards,
    Ramya S

    Hi,
    Thanks for your reply. But I need not calculate the sum to update it anywhere. I just want the total to be 1. I just want to reduce them to 3 decimal places and also retaining the the total as 1.
    Thanks,
    Ramya S

  • How the ROUND function helps to solve balancing accounts?

    As a developer, I'm being assigned to solved a bug in an application. In the application, large number transactions with credit and debit amounts are to be balanced. But before balancing, another calculation takes place. At the end of that calculation, the difference between the credit and debit amounts is not zero. There'll be a difference of about 0.02. Thus an application error is raised.
    Will there be a possibility of making use of the ROUND function and solving it? or are there any other functions provided by Oracle to solve such a situation?
    Thanks

    I guess, you should post here steps of example calculation. It also depends on the organization which rule it is following, I mean something like ignoring few decimal places etc.
    Please post the example.

  • How to write SQL query and apply aggregate functions on it

    Hello experts,
    Iu2019ve a task to write SQL query on tree tables and do inner join on them. Iu2019ve accomplish this task by using T-CODE SQVI. However now I need to write a query and apply SQL functions on it i.e. Add, Count, Max and Min etc. Please can someone tell me how I can write SQL query with aggregate functions in SAP?
    Thanks a lot in advance

    HI Mr. Cool
    you can see the below code for using aggregate functions.
    where ARTIST and SEATSOCCU are the field names for which you want to perform these functions.
    DATA: TOTAL_ENTRIES TYPE I,
          TOTAL_ATT TYPE I,
          MAX_ATT TYPE I,
          AVG_ATT TYPE I.
    SELECT COUNT( DISTINCT ARTIST )
           SUM( SEATSOCCU )
           MAX( SEATSOCCU )
           AVG( SEATSOCCU ) FROM YCONCERT INTO (TOTAL_ENTRIES, TOTAL_ATT,
    MAX_ATT, AVG_ATT).
    Thanks
    Lalit Gupta

  • How to return whole number using round function

    hi
    can i get sql query using round function how to return whole number value

    Hi welcome to the forum. if you want whole number value what does it mean
    1. whether you want the whole number greator than or eqaul to that number example for 12.6 you want 12 or 13
    see below example
    1.  SQL> select round(12.5) from dual;
    ROUND(12.5)
             13
    2.  SQL> select round(12.4) from dual;
    ROUND(12.4)
             12
    3.  SQL> select floor(12.5) from dual;
    FLOOR(12.5)
             12
    4. SQL> select floor(12.4) from dual;
    FLOOR(12.4)
             12
    floor will always give you a round value which is a integer or whole number less than or equal to but output of rond will differ if the value is greator than 12.5 it will give 13 but if it is less than 12.5 it will give 12, so depending on your requirement you can choose which function to use. similarly if you always want to get the whole number greator than the number you can use ceil as below
    SQL>  select ceil(12.3) from dual;
    CEIL(12.3)
            13
    SQL>  select ceil(12.8) from dual;
    CEIL(12.8)
            13

  • BPEL round function with precision for a decimal value?

    Dear All,
    I need to do a rounding of a higher value to 3 precisioned one.
    As per the round function available in Jdeveloper, I can only round a decimal to its respective integer value.
    But my requirement is to retain the decimal value, but with a limited precision value...
    How can I accomplish this.. Is there any extension of round function in BPEL to do this...?
    Please update..
    Many thanks...

    Use the function format-number(variable,precision_num)+.
    Thanks,
    Sen

Maybe you are looking for

  • Mapping problem on different levels. (IDOC) to XML

    I am having a mapping issue with a multi segment IDOC. It seems that it should be pretty straight forward but I am struggling. I have looked at some pretty good documentation but it still doesn't seem to help. The IDOC segments deal with text lines i

  • How to recover the smart center

    I replaced the hard drive in my TouchSmart 300-1129 I had to install a new operating system because my recovery disk was not compatible with my new hard drive. Now I have lost the smart center. And I can not figure out how to fix it and or recover it

  • Calling function in procedure...A tricky one

    hi guys, Here is a tricky thing ... There is actually a Whole book which has Risk and XYZ portfolio books and other books as well. The below procedure actually select the risk books based on FLAG =N else it will select all the books. Now i need to mo

  • Handling Unit procedure

    Hi All, please explain the handling unit procedure and its link to QM module. Regards, DTD

  • Externalise Users from Essbase on windows server to shared services on unix

    Hi All, We have Essbase 11.1.1.3 installled on Windows 2003 service pack1 and we have Shared services on SUN OS 5.10 with Hyperion version 11.1.1.1 and when we are trying to externalise the users from essbase to shared services we are facing an error