Including a variable in cmax

This is a very simple one... but it is slowly driving me mad.
I have some data, i want to know the maximum, but i want to go through several channels so i'm using a variable for my channel number....
Option Explicit  'Forces the explicit declaration of all the variables in a script.
dim data
dim maxval
dim minval
data = "ch(" " [1]/[2] " " ) "
maxval=CMax("&data& " )
minval=CMin(ch("&data& " )
I get an error of " An invalid text operand is used within the index operation of the formula CHNMAXVAL(0) : "
I've tried various syntaxes and it still won't work...
(i added in some spaces on this post to stop the code being full of smiley faces)
cheers.

Hello Tom!
Keep it simple and try this:
Option Explicit
dim data
dim maxval
dim minval
data = "[1]/[2]"
maxval=CMax(data)
minval=CMin(data)
Matthias
Matthias Alleweldt
Project Engineer / Projektingenieur
Twigeater?  

Similar Messages

  • Open URL including a variable

    I want to open a specific URL in Safari which has to be like this: +http://website.com/variableothertext
    where variable is a variable I created before. I tried the action "Obtain specified text", linked to "Show webpage", but I can't figure how to include my variable into the text field of "Obtain specified text", since when I try to drag that variable into it, it simply creates an "Obtain variable value" action.
    What should I do instead?

    Hello Tom!
    Keep it simple and try this:
    Option Explicit
    dim data
    dim maxval
    dim minval
    data = "[1]/[2]"
    maxval=CMax(data)
    minval=CMin(data)
    Matthias
    Matthias Alleweldt
    Project Engineer / Projektingenieur
    Twigeater?  

  • Include a variable in message string

    Hi,
    I want to include a variable in the message string like:
    wa_log-msg = 'Length for material number should be ' (here I want to iclude variable holding the length).
    How to do this?
    Thanks in advance...
    Regards,
    Sriram

    Hi, Sriram
    Hope following will solve out your problem,
    DATA: msg TYPE string,
          vlen(2).
    vlen = 19.
    CONCATENATE: 'Length for material number should be ' vlen INTO msg SEPARATED BY space.
    Best Regards,
    Faisal

  • How to include a variable in a formula calc

    Hi,
    I need to do some calc formula to help my report but I encounter a problem.
    I use this formula to erase some data from my channel but the formula don't reconize my variables.
    R4 = CMax(Ch("[1]/TRAVEL_DISTANCE"))
    Call DataBlDel("[1]/TRAVEL_DISTANCE_SMT",ChnFind("Ch(""[1]/TRAVEL_DISTANCE"")>R4",1),2000,1)'... ChnNoStr,ChnRow,ValNo,ValDelOnly , but the formula for the ChnRow don't see the variable R4, and if I put " before R4( to make R4 green) I receive an error : Expected ')'.
    Please tell me how I can use a variable in a formula , so the formula can see it.
    Thanks
    Solved!
    Go to Solution.

    Hi marse,
    The smiley face inserted by the text editor got in our way.  If you replace the smiley face in my reply with a "close-parenthesis" character, then the code will run correctly.  I have to admit, though, that there does appear to be a logic error, despite the fact that the code ran correctly on the data set I tried it with.  But finding the row of the peak is something you can do less ambiguously and more easily with the PNo() function:
    R4 = CMax(Ch("[1]/TRAVEL_DISTANCE")) Row = PNo("[1]/TRAVEL_DISTANCE", R4)Call DataBlDel("[1]/TRAVEL_DISTANCE_SMT", Row, 2000, 1) 
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • Can I include a variable in I_step = 2 and I_step =3.-urgent

    Hi All,
    I have a variable which has to get value from another variable.
    For this I can write coder under I_Step =2 and make the variable not ready for input.
    But I have to allow user also to enter some date.
    Please help me in regarding this..

    Hi,
    let the user enter his date in another variable ready for input. include both vars (the input and the exit) as filter of your char...
    hope this helps...
    Olivier.

  • Using include with variables (String)?

    Is it possible to include a *.jspf page from a variable (string)?
    I'm currently trying something like this, but I know it isn't quite correct (the PAGE string is already defined):
    <%@ include file="${PAGE}" %>I'm sure this is simple, but I'm pretty new to using JSP (I'm used to normal Java classes and the JSP syntax can be confusing at first...).
    Thanks!

    Ok, you're mixing up your EL expressions with scriptlet variables.
    These things are not the same.
    String PAGE = "pages/home.jspf"; decleares a scriptlet variable called PAGE
    You can normally access it using the scriptlet expression tag like <%= PAGE %>
    ${PAGE} is an EL expression.
    The EL variables are stored as attributes in the page, request, session and application scopes.
    So ${PAGE} will not give you the value of the scriptlet variable Page.
    ${PAGE} is approximately equal to pageContext.findAttribute("PAGE") in java.
    Probably the easiest fix would be to use a scriptlet expression rather than an EL expression.
    <jsp:include page="<%= PAGE %>"/>The better fix would be not to use any scriptlet code at all in your JSP, and maybe just use the JSTL conditional tags.
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <c:set var="PAGE" value="${requestScope.page}"/>
    <c:if test="${empty requestScope.page}">
      <c:set var="PAGE" value="pages/home.jspf"/>
    </c:if>
    <jsp:include page="${PAGE}"/>
    //or
    <c:import url="${PAGE}"/>Cheers,
    evnafets

  • 10g default footer including server variable

    Hi Experts,
    I need to solve the following task and I am not sure how to do that (using a BIEE 10g version):
    When printing a single report or dashboard page, my customer would like to see the following information attached to every single report:
    a) a timestamp when the report was printed (not refreshed in BIEE)
    b) a value of a server variable telling when the data in the report has been updated (the variable is defined in the repository)
    How do I get these 2 values into a report footer?
    Is there a way to define a default footer including the 2 values?
    Thanks for your help
    Regards
    Andy

    Hi Andy,
    This might be of help for you http://varanasisaichand.blogspot.com/2010/02/adding-footer-view-to-reports-in.html
    If this doesnt work you take a variable into a column in the report and when printing the report make sure take into consideration. Instead of printing time you can go for the report executed time in the title check for data and time.
    hope helps you.
    Cheers,
    KK

  • How to include the variable as a part of the sqlStatement in doGet Servlet

    How can I get the variable empnum as a part of the sqlStatement. I am getting an error.
    String empnum = req.getParameter("empnum"); --Works
    out.println("THE empnum IS : " + empnum); -- Works
    String dsJndi = "jdbc/OracleCoreDST"; -- Works
    String sqlStatement = "select from HR_TABLE where HR_EMP_NUM=empnum";* - Works if empnum is hardcoded.
    Thanks so much for the help in advance
    KA

    Thanks John..! Opened my eyes ;)
    Was a bit reluctant with the users repeated basic questions - my bad and apologies.
    It should have been
    String sqlStatement = "select * from HR_TABLE where HR_EMP_NUM=?";
    PreparedStatement pt = c.prepareStatement(sqlStatement);
    pt.setInt(1, Integer.parseInt(empnum));
    ResultSet rs = pt.executeQuery();though the 1st solution works..!
    regards,
    ~K

  • How to Include Date variables in the Attachments sent via ibots

    Hi Experts,
    I have a requirement that when i configure an i-bot , i need to get a mail with attachment as an excel say "attname".This is fine,but how to customize such that the attachment contains date variables like "attname_24April2010" when recipients receive the mail?
    Also if this is possible then when i open the attachment, then it should have the title with report name and date variables? Can we achieve this?

    You can put varables in several views in OBIEE (e.g., Narrative, Title, etc.). BTW, in the Title View, you can also use built-in variables that display the run date and time.
    Click on this link to get the syntax:
    http://shivabizint.files.wordpress.com/2008/10/obiee-variables-overview.jpg

  • Can a view include a variable

    So what I'm trying to do is create a modified version of a view that can accept a date range when run. I have come across references to "parameterized views" and views using "context variables". Can someone help me understand the difference between the two and which approach is better for my situation?
    Here is a sample of one working view (there are dozens):
    CREATE OR REPLACE FORCE VIEW  "VF_PAYLOAD_BYMONTH"
      ("FACTORY_ID", "MONTH", "LOADS",
          "TTL_BIDTONS", "AVGBIDPAYLOAD",
          "TTL_ACTTONS", "AVGACTPAYLOAD") AS
      (select FACTORY_ID, to_number(to_char(DT,'MMYYYY')), SUM(LDS),
          SUM(TTL_BID_TONS), AVG(AVG_BID_TONS), SUM(TTL_ACT_TONS), AVG(AVG_ACT_TONS) from
      (select j.FACTORY_ID, c.DATE_INDEX as DT, COUNT(j.LOAD_JOB_ID) as LDS,
            SUM(DECODE(r.BID_TONS,0,NULL,r.BID_TONS)) as TTL_BID_TONS,
            AVG(DECODE(r.BID_TONS,0,NULL,r.BID_TONS)) as AVG_BID_TONS,
            SUM(DECODE(w.SPOT_WEIGHT,0,j.MAN_SPOT_WT,w.SPOT_WEIGHT)) as TTL_ACT_TONS,
            AVG(DECODE(w.SPOT_WEIGHT,0,j.MAN_SPOT_WT,w.SPOT_WEIGHT)) as AVG_ACT_TONS
         from TC c, TC_LOAD_JOBS j, LOAD_RATES r, SPOT_WEIGHTS w
        where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID and r.YARD = 0
          and c.DATE_INDEX = w.DATE_INDEX and j.LOAD_RATE_ID = w.LOAD_RATE_ID
        group by j.FACTORY_ID, c.DATE_INDEX)
      group by FACTORY_ID, to_number(to_char(DT,'MMYYYY')))
    /This is what I am after:
    CREATE OR REPLACE FORCE VIEW  "VF_PAYLOAD_BYMONTH"
      ("FACTORY_ID", "MONTH", "LOADS",
          "TTL_BIDTONS", "AVGBIDPAYLOAD",
          "TTL_ACTTONS", "AVGACTPAYLOAD") AS
      (select FACTORY_ID, to_number(to_char(DT,'MMYYYY')), SUM(LDS),
          SUM(TTL_BID_TONS), AVG(AVG_BID_TONS), SUM(TTL_ACT_TONS), AVG(AVG_ACT_TONS) from
      (select j.FACTORY_ID, c.DATE_INDEX as DT, COUNT(j.LOAD_JOB_ID) as LDS,
            SUM(DECODE(r.BID_TONS,0,NULL,r.BID_TONS)) as TTL_BID_TONS,
            AVG(DECODE(r.BID_TONS,0,NULL,r.BID_TONS)) as AVG_BID_TONS,
            SUM(DECODE(w.SPOT_WEIGHT,0,j.MAN_SPOT_WT,w.SPOT_WEIGHT)) as TTL_ACT_TONS,
            AVG(DECODE(w.SPOT_WEIGHT,0,j.MAN_SPOT_WT,w.SPOT_WEIGHT)) as AVG_ACT_TONS
         from TC c, TC_LOAD_JOBS j, LOAD_RATES r, SPOT_WEIGHTS w
        where c.TC_ID = j.TC_ID and j.LOAD_RATE_ID = r.LOAD_RATE_ID and r.YARD = 0
          and c.DATE_INDEX = w.DATE_INDEX and j.LOAD_RATE_ID = w.LOAD_RATE_ID
          and c.DATE_INDEX between :X and :Y   <-----  ADDED THIS
        group by j.FACTORY_ID, c.DATE_INDEX)
      group by FACTORY_ID, to_number(to_char(DT,'MMYYYY')))
    /What I'd like to do is place a date range on the underlying query. The user wants two versions of the report: one that grabs everything by month and one that grabs everything by month but only within a certain date range.
    PS. If this is possible, how do I "call" the view?

    re Centinul : This is actually getting called using a procedure in APEX to generate a report. The entire report consists of one or more of these procedures: each one calculates a year's worth of metrics related to a given category and the data comes from a variety of source tables. I used views to ease the creation of the procedures, but maybe that's the wrong way to go. The thing is that the data has to be condensed (the view) then translated from rows into columns (handled in SQL in procedure) because I am on 10g (I don't have the PIVOT capability in 11g which would REALLY help simplify these reports a LOT). Putting it into views makes it easier to keep track of what is going on.
    re Ajay Sharma, bluefrog, and AP: Yes, I saw those. Spent half an hour on AskTom, but the thing I didn't see was just a basic explanation of purpose and how to use it. The articles I saw kind of skipped that part, which was why I was asking here for an explanation.
    re Frank Kulash: Thanks for the detailed explanation. As the view is going to be referenced from APEX, which shares a common execution user, I am questioning whether the parameterized approach would work at all, but I would appreciate input. It is looking more and more like I am going to have to incorporate the view directly into the procedure, as I will likely have more than one user attempting to access this report at the same time.
    Any other suggestions would be appreciated. Here is the query being used in the procedure. Please understand that this is one of the simple ones: several of the other views are composites formed from two, three, or even four base views. Manageability quickly becomes a major concern here.
    cursor c_PYLD_TARGET is SELECT NVL(SUM(CASE WHEN MONTH = to_number('08'||(v_dt-1))
              THEN AVGBIDPAYLOAD END),0) as "AUG",
            NVL(SUM(CASE WHEN MONTH = to_number('09'||(v_dt-1))
              THEN AVGBIDPAYLOAD END),0) as "SEP",
            NVL(SUM(CASE WHEN MONTH = to_number('10'||(v_dt-1))
              THEN AVGBIDPAYLOAD END),0) as "OCT",
            NVL(SUM(CASE WHEN MONTH = to_number('11'||(v_dt-1))
              THEN AVGBIDPAYLOAD END),0) as "NOV",
            NVL(SUM(CASE WHEN MONTH = to_number('12'||(v_dt-1))
              THEN AVGBIDPAYLOAD END),0) as "DEC",
            NVL(SUM(CASE WHEN MONTH = to_number('01'||v_dt)
              THEN AVGBIDPAYLOAD END),0) as "JAN",
            NVL(SUM(CASE WHEN MONTH = to_number('02'||v_dt)
              THEN AVGBIDPAYLOAD END),0) as "FEB",
            NVL(SUM(CASE WHEN MONTH = to_number('03'||v_dt)
              THEN AVGBIDPAYLOAD END),0) as "MAR",
            NVL(SUM(CASE WHEN MONTH = to_number('04'||v_dt)
              THEN AVGBIDPAYLOAD END),0) as "APR",
            NVL(SUM(CASE WHEN MONTH = to_number('05'||v_dt)
              THEN AVGBIDPAYLOAD END),0) as "MAY",
            NVL(SUM(CASE WHEN MONTH = to_number('06'||v_dt)
              THEN AVGBIDPAYLOAD END),0) as "JUN",
            NVL(SUM(CASE WHEN MONTH = to_number('07'||v_dt)
              THEN AVGBIDPAYLOAD END),0) as "JUL"
         from VF_PAYLOAD_BYMONTH
        where FACTORY_ID = v_proj;
    ...(might help to get the right one)
    Edited by: blarman74 on Aug 24, 2010 11:10 AM

  • How to include variable in the text column in report painter?

    Dear Expert,
    Would like to seek for your help to include How to include variable in the text column in report painter?Please advice.
    Thank you.
    Regards,
    Karen
    Edited by: Karen Swee Ping Ho on Jun 17, 2011 2:48 AM

    Hi,
    Thank you for the promt reply.
    1) How I include the variable in the column header to display fiscal year which I have selected from the selection screen?
    which variable should i use?
    2) Where can i find more information about the characteristic and which variable to be use base on the characteristic?
    For example: I would like to display the fiscal year from the selection screen/input screen when execute the report which also will reflected to the element definition and will display the fiscal year also in the column text?
    3) Kindly advise base on question 2, the variable that i use in element definition it will also display  in selection screen?
    4) When execute the report the first selection screen input parameter it obtain from where it is from element definition?
    5) Please advice how to be done when report execute with first screen input selection will also reflect the element definition of column and rom with the selection of the fiscal year?
    Please help.
    many thanks
    Edited by: KH on Jun 18, 2011 7:18 AM

  • How can I include a captivate variable in the URL of the website widget?

    I am using the website widget to bring up some customized content during the course.
    The URL contains a variable which will be different for every user.
    I can't find the option of including a variable in the URL with the widget.
    Has any figured out how to accomplish this?

    I am using Cp8.
    I publish in both swf and html5 formats so that the course functions on all device platforms.
    A swf only solution would preclude IOS since it doesn't support flash.

  • Discoverer Plus - How to include variable text in the Title

    Hi,
    I need to include a variable text in the report like the user information or another information i woul like to obtain from a query that is not the standars date,time,... oracle discoverer plus improves us.
    I tried with calculations associates to a parameters, but is not possible.
    I hope i explained correctly.
    Thanks,

    This can be done by creating a parameter, then a calculation, then a condition. Then under "Edit Header" or Page Setup, choose "Header" or "Footer"as needed and choose to insert the Parameter.
    Step by step Example instruction:
    1-Create a parameter as follows:
    --Item = NONE
    --Name = "Workbook run by" (This will appear in the heading or title when workbook run)
    --Prompt = "Please enter UserID in all capital letters"
    --Description and Default value left blank
    2-Create a Calculation
    --In New Calculation choose "Function" then choose the function "USER" from Database. (This is all that the calculation will need.)
    --Name Calculation  = i.e.: "DB_USERID" 
    3-Create a condition as follows:
    --Name = Request_UserID
    --Item = DB_USERID
    Condition = IN
    Value = Choose parameter: Workbook run by
    -Double click on worksheet title, choose Insert, then choose Parameter (This can be done the same way under Page Setup for Header and Footer
    -The calculation will create an extra column which I put at the top as a Page Item
    -This will force the user to enter the UserID they are logged in to Discoverer with.
    -This is case sensative. Therefore, since all Databe IDs are stored on the Database in all-caps, then the user will have to enter in all caps as well.
    Thanks,
    Sutirtha

  • Can i include variable in select into statement?

    Hi all,
    Is it possible to include a variable name in the "select into" statement ? For ex:
    "Select empname into variable_Name from employee" In this case variable_Name is the variable.Will this statement work by assigning empname to variable_Name if there is only one record in the employee table?please reply....c ya.

    Surely you have to? You can hardly SELECT INTO a constant. Perhaps I'm missing something,

  • Include variables in excelsheet sent from Broadcaster

    when I mail the report as a excel attachment - is there any way I can include the variable's that have been passed thru variant be displayed in the excelsheet - just like the way we get when we do a PDF - default print version- with all the variables, dynamic and static filters. I tried playing around, but not sure where I should be looking at - at the Query Precalculation template or is there some setting in broadcaster wizard or just some other IMG config.
    Appreciate if anyone can throw some light on it
    Thanks,
    Voodi

    Hi Voodi,
    Did you find a way to include the variables in excel sent from BEx Broadcaster.
    If you had found anything regarding this please let me know.I have this requirement.
    Thanks
    Raj

Maybe you are looking for

  • I want to view my library as a file

    Can I save my library as a file? That way, I have a list of all my songs/artists etc? I need this for my other computers so when I'm downloading songs I can see if I have it already.

  • Mount PenDrive Using Command-Line

    Hello, I'm a C++ developer and i'm a Ubuntu user, but i installed Arch Linux and i want tp mount my pen-drive, but i don't know what is the driver assing, because when i want to mount something i know what is the driver name like sda1, but i don't kn

  • Problem by entering Persian\Arabic characters in String Control

    I'm working on a Jet Printer project. I must make an user interface using LabVIEW. This printer must print some Unicode characters on factory's products. Specialy Persian and Arabic characters. But it seems that there is not a string control with cap

  • Error:6 when a non-admin user tries to run Adobe Photoshop Elements 9

    Loaded Photoshop Elements 9 on a computer that is not on the internet and works fine as long as the user logging into the computer has admin privileges but a user who does not have admin priviledges gets an Error:6 that says to uninstall and reinstal

  • SAP BW Business Blueprint

    Hi All I am in urgent need of SAP BW Business BluePrint. Please anybody send me at [email protected] Regards M FAROOQ ALI