Using "-" in a variable without calculating

This should be an easy one... when I have a # in the output,
to cancel it out, I add another one (ie. color=##ffffff). But I'm
having problems with the same type of thing if I use a hyphen/minus
sign "-".
I have three variables that I'm trying to merge as:
#variable1#-#variable2#-#variable3#
so the number when I do CFSET should be something like
1234-5678-9000
I tried adding another - sign and it just calculates that
too.
But if I try to set that as a variable, it does the
calculation instead. I hope this makes sense :)
Is there a way to cancel out the - so it doesn't calculate it
and just places it in the variable? I'm using CF 5.
Thanks!

> I have three variables that I'm trying to merge as:
>
> #variable1#-#variable2#-#variable3#
Doing that you're treating them like numeric values with the
minus operator
bewteen them, hence it's interpretting the expression
literally.
What you need to do it to consider that what you're trying to
do is to
create a string. So you need to put string-delimiters around
the
expression, or use the string-concatenation operator:
"foo bar"
or
"foo" & " " & "bar"
Adam

Similar Messages

  • How to  use data function using characterstics variable for calculation on

    how to  use data function using characterstics variable for calculation on  attribute as key figure

    Hi Gayatri
    Did you not see my answer for CASE because CASE does indeed offer the use of the BETWEEN clause, but DECODE does not. Let me give you a little synopsis of DECODE.
    In its most simple form it takes 4 values and looks like this: DECODE(A, B, C, D)
    This essentially means, IF A = B THEN C ELSE D
    The trick to solving BETWEEN in a DECODE is to work out algoriths where A = B. Because we don't know how many values are between 00 and 99, although I could guess there were 100 we could of course have 100 parts in the DECODE but that would be awful. How about if we look at it another way and say this:
    IF PART_NUMBER < 'SDK00' THEN pay_amount
    ELSE IF PART_NUMBER > 'SDK99' THEN pay_AMOUNT
    ELSE pay_amount + 100
    This statement only had 2 hard coded values, but how to make DECODE work with less than? Easy, we use the LEAST function. The LEAST function takes 2 values and returns the one with the lowest value. So I use LEAST(PART_NUMBER, 'SDK00') then whenever the PART_NUMBER is lower than SDK00 it will be true. A similar situation exists for the opposite function GREATEST. Putting all of this together then, you can do this:
    DECODE(PART_NUMBER, GREATEST(PART_NUMBER, 'SDK00'), DECODE(PART_NUMBER, LEAST(PART_NUMBER, 'SDK99'), PAY_AMOUNT * 100, PAY_AMOUNT), PAY_AMOUNT)
    In English this can be read as follows:
    IF the PART_NUMBER is greater than or equal to SDK00 and the PART_NUMBER is less than or equal to SDK99 THEN PAY_AMOUNT x 100 ELSE 0
    Best wishes
    Michael

  • How to Set multiple Global Variables without using Controls or Indicators

    I have to set many Global Variables (i.e. declare and initialize them) in a subVI in order to pass them to various other subVI's. The only way I know how to do it in LabView is to create a Globals.vi on which you create a control or indicator for EACH Global Variable. That's fine if you have only a few variables. But I have close to a hundred Global Variables (which come from a configuration file for a large program) and clearly it is impractical and cumbersome to create a control for each global variable. In Agilent Vee, there is a simple function called "Set Variable" that sets the data value of a global variable. Then in other module, you simply use the "Get Variable" function to get back the v
    ariable and its value.
    In LabView you can use the "Invoke Node / Set Control Value" and "Get Control Value" properties to achieve the same thing. But as mentioned above, you need to create a control for each global variable and that is a big pain in my case, with many global variables. Furthermore, the global variables are read from a Configuration Text File to this VI. Is there a way to do it without using the control? Thank you in advance for any help.

    Actually you could create the same sort of facility in LV. All you have to do is create a LV2-style global that behaves as follows:
    To write a value to it, you supply a value name and the value. These pieces of data are save internally in seperate arrays.
    To read a value, you supply a value name. The VI looks up this name in the value name array to return an index into the value array. Output the value you find.
    Frankly though, it sounds like what you really need is not hundreds of globals, but a good way to manage configuration data.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How do you swap two variables A and B without using a 3rd variable?  No fun

    How do you swap two variables A and B without using a 3rd variable? No function or method allowed.
    For example:
    Given:
    A = 35
    B = 10
    Result
    A = 10
    B = 35

    How do you swap two variables A and B without using a
    3rd variable? No function or method allowed.
    For example:
    Given:
    A = 35
    B = 10
    Result
    A = 10
    B = 35
    A = A + B  (A = 35 + 10 = 45)
    B = A - B (B = 45 - 10 = 35)
    A = A - B (A = 45 - 35 = 10)

  • How do you swap two variables A and B without using a 3rd variable?

    How do you swap two variables A and B without using a 3rd variable? No function or method allowed.
    For example:
    Given:
    A = 35
    B = 10
    Result
    A = 10
    B = 35

    How do you swap two variables A and B without using a
    3rd variable? No function or method allowed.
    For example:
    Given:
    A = 35
    B = 10
    Result
    A = 10
    B = 35
    A = A + B  (A = 10 + 35 = 45)
    B = A - B (B = 45 - 35 = 10)
    A = A - B (A = 45 - 10 = 35)

  • How to use Replacement Path Variables to perform Date Calculations

    Hi Experts,
    Can anyone make me clear about:How to use Replacement Path Variables to perform Date Calculations???????
    Thankyou in advance..
    shankar

    In left panel select the time Dimension
    Then hit new variable in that
    give the Name and Description for the Variable
    In processing by hit Replacement Path
    In reference characterisitcs use Calendar Day...
    As ur intention is to use it for Date
    Then in adjacent tab use
    Replace variable with Query / Variable
    Then u can use Offset length and offset start for controoling the display of your variable.
    Use as single, multiple single, interval, selection option as uwish
    HIt okey
    and you are good to go

  • Calculating FFT using the FFTAverageType variable in DIadem

    Hi,
    I have some doubts about how should I use the averagingType variable. I want to define this variable as "Arithmetic" and get the combined FFT of two trials of the same process, i.e I have two signals which represent the same process.
    What I do is just calculate the FFT of each signal separately. Then I calculate the amplitude of each FFT signal and finally i combine these two signals by doing the mean for each amplitude. I.E if i have signal1FFT = (1 , 2 ......23 ) and signal2FFT = (2,4, ...43 ) the resulting signal should be ( 3/2 , 6/2 ...... 66/2 )
    Am I correct about what this averaging type variable does? When i try to do the same in other mathematic programs I get different results but I don't know exactly what I am doing wrong,
    Thank you so much for the help!

    There are several ways to approach averaging in the FFT environment.
    FFTAverageType is should be "Arithmetic" which means that all FFTs are weighted equal.
    The Exponential averaging is kind of a running average for special calculations which are typically done during a running measurement.
    Much more important is the parameter in "Calculate average from:" (Amplitude or Autospectrum)
    Amplitude is giving a linear result and Autospectrum is giving the result based on squared values. The squared result is the correct result from an energetic point of view.
    Example:
    If you have a sine with a peak of 2 for one second and a peak of 4 for another second, you might want to get and averaged peak of 3.This might be wrong.
    The RMS value of a sine with a peak of 3 would be 2.121.
    The RMS which is representing the energy in a signal is the root of the average of the squared values. The RMS of a signal with half the time 2 and half the time 4 is 2.236. This means, that a sine with the peak of 3.162 for two seconds has the same RMS as the signal with a peak of 2 and 4 for one second each.
    If you average FFTs in DIAdem you need to decide between the linear average (based on the peak Amplitude) and the energetic correct squared average (based on the Autospectrum). Right or wrong depends on your circumstances.
    Usually, other mathematic programs are giving you the choice to decide or they might just use one or the other method.

  • How to swap two string variables without using a 3rd variable?

    How to swap two string variables without using a 3rd variable?
    ex.
    A = "aa"
    B = "bb"
    Result required
    A = "bb"
    B = "aa"
    Thanks

    How to swap two string variables without using a 3rd
    variable?
    Something like this.
    Append A with B (so A equals "aabb")
    Set B equal to a substring of A starting with the first character and ending at A's length minus B's length. (So B equals "aa")
    Set A equal to a substring of A starting from B's length and ending at the end of A. (So A equals "bb")

  • Using Replacement Variables Without Filtering in a Query

    I want to use a replacement variable for the posting period and for current fiscal week, but I do not want my query results to be filtered by these values.  Instead, I just want to show a column with the fiscal period as a number and the current week as a number.  Does anyone know how to do this? 
    My query shows JAN-DEC values for all key figures but when I use the replacement variable to display NOV as a number, JAN-OCT is blank b/c the query is filtering by NOV.  I just want to see a column of "11s". 
    Any ideas?

    Hi Tracey,
    I was not able to reply you yesterday. After you gave the details, I had this solution in mind but it was a Friday evening and I had to leave.
    My understanding :
    When user enters the month in selection screen eg: 11 (Nov)
    The key figure which is getting displayed in the report till month of Nov should be KF1 else it should be KF2.
    So report should be like this
    Jan  - KF1
    Feb  - KF1
    Mar  - KF1
    Apr  - KF1
    May  - KF1
    Jun  - KF1
    Jul  - KF1
    Aug  - KF1
    Sep  - KF1
    Oct  - KF1
    Nov  - KF1
    Dec  - KF2
    Solution:
    Make a Restricted KF - RKF1
    This will have KF1 with a restriction on the month column "<= " month enetered by user in selection screen (use the same variable)
    Make one more Restricted KF - RKF2
    This will have KF2 with a restriction on the month column "> " month enetered by user in selection screen (use the same variable)
    Now make a Calulated KF
    CKF = RKF1 + RKF2
    Use this in your report.
    I think this is what you are trying to get.
    Please do award points if you found this useful.
    Regards, Mey

  • Bex variable not calculating when using on a workbook

    Hello!
    I've created a variable on 0date.
    The default value is the current month.
    The code is in ZXRSRU01 with i_step = 1.
    When calling this variable using the query the value is correctly shown :
    For exemple we are in march, the variable default value is 03.2011.
    But the workbook based on this query don't update the variable default value:
    The workbook shows all the time "02.2011" even if we are in March.
    In fact, this workbook was saved in February, he seems to remember that value.
    How to make dynamic variable in workbook ?
    regards,

    Not sure if you have tried this, if not give it a try.
    In workbook properties, there is a setting 'Process variable on refresh' - if this is checked the workbook uses the saved variable.
    from [http://help.sap.com/SAPhelp_nw70/helpdata/en/54/a493f7256b43698191a2623e5a0532/content.htm]
    Process Variables on Refresh
    If any query in your workbook contains variables, any current values set for the variables are part of the query view definition and are therefore stored in the workbook.
    Set this indicator if the values saved in the workbook are to be used automatically.
    You should have this unchecked.

  • Error in query when using offset in variable

    Hi,
    I have a query in which I use av variable (0CWEEK) for the current week. The query works fine with this varable. But when I use an offset of for example minus 1, the query displays an error:
    (A299(BRAIN)) Terminate: System error in program SAPLRRI2 and form REP_ASSIGN_INITIAL_OPT-01
    We use offset of 0CALWEEK in other info cubes, and there are no problems with that.
    In this case we have implemented 0CALWEEK in a DSO. Perhaps this somehow causes the problem? On the other hand the variable works fine in the DSO, as long as we don't use offset.
    So - why is there a error, and how to solve it?
    BR,
    Niclas

    Managed to solve the problem. The reason was that there was no column (or row) with the variable without offset. I.e. there needs to be a column for the actual week in the query as well, not only week with offset. In this case I didn't want the actual week, only an offset to it. So I just hid the column with the actual week from presentation.
    /Niclas

  • Use of Input Variables in SQL-Queries Sometimes Not Possible

    Only in simple SELECT-statements the use of input variables ([%0], [%1], etc.) work without problems.
    In more complex queries the use of these variables is not possible (e.g. SELECT-statements with sub-queries, sometimes when UNION is used - but I couldn't find any general rule when the problems will arise; sometimes two different queries with the same query-structure behave in different ways when these variables are used).
    In these cases the query is not executed - not even the input-window to enter values into the input variables is displayed. The query stops with some strange error-messages in the status line. These error-messages doesn't have any relation to the actual query - sometimes it refers to field-names never used in the query or refers to syntax error which do not exist.
    If the input variables are replaced by constant values there are no problems so there can't be any syntax errors - the only difference is the presence or absence of input variables.
    Example:
      provided that the queries have a certain complexity
      SELECT ...
      FROM   ... OINV Tx ...
      WHERE  ... Tx.DocDate >= [%0] ...
      does not work,
      SELECT ...
      FROM   ... OINV Tx ...
      WHERE  ... Tx.DocDate >= '1.1.2007' ...
      works!
    Does anybody have run into the same problem and now if it is a bug of SAP-BO or an error on behalf of the user? Does anybody know a way to correct the problem?
    Thanks in advance!
    Frank
    By the way: Are there any rules where exactly input variables can be used in a query?
    Only in SELECT-statements? Where there exactly?
    In statements outside of SELECT?

    Only SAP Partners Can access service.sap.com/notes, but I think it is possible to search in them from the customer portal as well.
    Here are summary of the two notes mentioned before this:
    730960:
    <i>
    The following query is an example for how to define variables in long
    queries rather than using "Fixed Declares".
    You need to use exactly the same template as follows, do not delete
    "comments" from this query.
    The only changes you need to do :
    1. In the first and in the fifth rows you need to select the table to which you would like to relate the variable e.g. in this example, the variable is related to the table VPM1 - 'Payments to Vendors - Rows'.
    2. In the fourth and in the eighth rows you need to select the field to which you would like to define the variables e.g. in this example, the variable is the field 'DueDate'.
    /SELECT FROM [dbo].[VPM1] T0/
    declare  @fromdate as datetime
    /* WHERE */
    set @fromdate = /* T0.DueDate */ '[%0]'
    /SELECT FROM [dbo].[VPM1] T1/
    declare  @tilldate as datetime
    /* WHERE */
    set @tilldate = /* T0.DueDate */ '[%1]'
    select  OVPM.docnum, VPM1.dueDate,VPM1.CheckNum, VPM1.Branch,
    VPM1.BankCode, VPM1.CheckSum, OVPM.CardName,
    case
    when OPCH.docnum is null then VPM2.docEntry
    else OPCH.docnum
    end as 'docnum'
    from OVPM INNER join VPM1 on OVPM.docnum = VPM1.docnum
    left join  VPM2 LEFT JOIN OPCH ON VPM2.DocEntry = OPCH.DocEntry
    on OVPM.docnum = VPM2.docnum
    where OVPM.Canceled = 'N' AND VPM1.DueDate >=@fromdate AND
    VPM1.DueDate <=@tilldate
    </i>
    955295:
    <i>
    Using SAP Business One Survey Variables (parameters) in a 'Set' SQL Statement can give an error in the Query Generator.
    For Example:
    Declare @Num as numeric(2)
    Set @Num = [%0]
    Select T0.DocNum
    From ORDR T0
    Where DocNum = @Num
    Other terms
    query, SQL, parameter, survey, variable, query generator, set, declare, [%0], table, error, SAP Business One
    Reason and Prerequisites
    FAQ
    Solution
    In such cases you need to put in an SQL remark statement a reference field in the DB for the Survey Variable (any field).
    For Example: (to make the above query work)
    Declare @Num as numeric(2)
    Set @Num = /* T0.DocNum */ [%0]
    Select T0.DocNum
    From ORDR T0
    Where docnum = @Num
    </i>

  • Using a dummy variable in a  customer exit

    I currently have a report that uses 0calmonth = Current Month (SAP Exit)
    Now, this works fine when running for the month, but if a user wants to see the last completed month I'd need to setup a separate report that says
    0calmonth = last month.
    These reports are broadcasted automatically by e-mail, this is why I don't want to specify the actual requested month n the variable, I'd need to change my settings all the time.
    I have a whole bunch of reports setup that way and I don't want to duplicate them all, what I had in mind was to use a dummy variable in which the user enters a value CMTD or LMTD.  These values would then be used in a customer exit of the kind:
    IF CMTD set as current month
    else if LMTD set as last month
    I have no problem with that last part, but how do I create that dummy variable and is there anyway (without adding an infoobject in my cube) to have it include in the F4 menu the two option CMTD and LMTD (which are really meaningless abbreviations...)
    Thanks all for your help.
    Eric
    Message was edited by:
            Eric Blondin

    OK, this was actually easy, I used a text variable to feed in CMTD or LMTD.  Any way to have the two values available as options?  Text variables don't provide a selection box...

  • Date only variable (without time) possible in email body in workflow?

    My workflow sends an email.  It uses a date variable in the body of the email.  On the SP UI I have the option to only display the date (no time).  Is there a way to do that in the email too?  It is displaying 12:00:00 as part of my date, which in this instance causes confusion.
    As a solution I created a calculated field called Due Date Calculated.  It takes the Due Date field and uses this calculation =TEXT([Due Date], "mm/dd/yyyy").  Though the workflow validator said there were no errors, it will not send the email with this in the body of the email.  I don't understand why, as it is just another column in my list.

    Hardesh, he already said that's exactly what he did...
    Jiggashah, so you're not saying that the variable isn't present, but rather that your email isn't being sent?  You need to figure out that part first.  We can't tell you why the email isn't being sent.  How is the workflow built?  What are the steps?  What is the logic?  Do you have conditional branching?  Are you using "log to history list" actions all through the workflow so that you know EXACTLY what is happening and what ISN'T happening?  Is the workflow completing, or is it erroring out?  There are tons of details left out so far.
    SharePoint Architect || My Blog

  • No difference between using a local variable and a notifier in timed parallel loops?

    The example code "Pass Data With Notifiers.vi" that came with LV 7.1 illustrates using notifiers with parallel loops.  Just looking at two of the loops, the one that generates the sine wave and the one for "User 1", you can change the timing of the two loops and you can change the condition of the "Ignore Previous" status on the "Wait on Notification".  I have a special case of this to consider, where I'm wondering if there's any reason not to use a local variable instead of the notifier:
    Set the delay on the generator portion (which contains the Send Notification) to something very short, say 5 ms.  Set the delay on the User 1 (which contains the Wait on Notification) to something relatively longer, say 200 ms.  Set the Wait on Notification to False.  Now you have a situation where the User 1 loop action is contingent only upon the loop delay time, since each time the loop timer runs the loop there will always be a value in the notifier.  In this case it seems to behave just like the case where you update a local variable in the fast loop and read it in the slow one.
    Is my understanding correct?  Would there be a performance difference between the two methods?  What do you prefer in this situation and why?
    Thanks,
    Hosehead

    Hi H.,
    I think your idea is to write to a Global Variable in the data-producer VI, and read it in the data-consumer VI(?)
    One reason this might be less efficient than using Notifiers is if you want to graph every new value in the "consumer" - or make sure the value read in the consumer has changed at least once since the last loop.
    > since each time the [consumer] loop timer runs the loop there will always be a value in the notifier...
    > Would there be a performance difference between the two methods? 
    If you don't use the Notification "event" to synchronize the producer and consumer, then to be sure the consumer gets a new vaue, you've made the producer loop faster - every 5 ms - a waste of cpu-cycles.  More often the situation is reversed, that is, there's a consumer that needs to see every single new value, and (without events) the consumer must loop faster than the producer (to catch every new value) - this is called polling and it wastes cpu-cycles.
    Just about anytime one's tempted to make a loop execute "fast" to check on some value (or to make sure there's a fresh value,) there's an opportunity to improve performance through synchronization with events (including notifiers, queues, occurrances, semaphores, and rendezvous')
    tbd
    Message Edited by tbd on 07-09-2006 03:51 AM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

Maybe you are looking for

  • DVR to DVR Multi-Rroom Recording and Viewing - Can It Be Done?

    I'm considering switching from D*TV to FIOS but haven't done so yet because the FIOS DVR technology was far behind D*TV.  It appears to be getting much better since I last checked in with FIOS last year.  The new 7232 DVR with 500 Gig drive is a grea

  • Stuck with compiling a source file

    Hi, I'm stuck with this strange problem and i desperately need some help. My source file is in the D drive inside the package named objectwrite. The source file X.java is extending an abstract class named Y. When i'm trying to compile the files using

  • Recording short videos to post to website

    i would like to record short videos directly into my computer of one person at a time talking directly into the camera, edit these videos, and post to my website. it would be great to be able to add short bits of music, but not essential. i do a fair

  • Hover Underline Style in hyperlinks?

    In html and css coding, there is a way to specify a character style for when you hover over a link.. For example: a different color underline, or maybe the color inverts and a background color shows up behind the word) Is there a way to do such a thi

  • How to make a template from an existing document on my ipad Air 2 using word

    I want to know if it's possible to make make a template from an existing document on my ipad Air 2 using the free microsoft word app. Thank you