Setting mutliple variables and filters in operators

Hi all,
Playing around with the new liquid markup and loving it. Have two questions though that I couldn't find answers to in the docs.
1) Is it possible to set multiple variables in one line, or some better way than what I'm currently doing? At present I'm adding a new line per variable, so
{% assign var1 = 1 %}
{% assign var2 = 2 %}
Just thought there might be an easier way, like perhaps
     assign var1 = 1,
     assign var2 = 2
2) Is it possible to use filters in operators? If so I may be doing it wrong;
{% if numericVar1 | modulo: numericVar2 == 0 %} **do whatever **{% endif %}
My first thought is it is evaluating the second bit and using that for the modulo. So, if numericVar2 was "0", it would be trying to do "numericVar1 | modulo: (numericVar2 == 0)", rather than "(numericVar1 | modulo: numericVar2) == 0".
I also thought perhaps it might be related to the bug linked below, but I've had no issues in general using variables alone with filters, only when in operators.
Bug: Liquid math filters don't work with module data
Edited because I hit post too soon.

Hi there,
1. No, its not a high end language, what your doing is fine there.
2. Filters in operators work, but not all cases.

Similar Messages

  • How to set JNDI variable and update in Admin Console

    I want to create a JNDI variable in weblogic admin console and then I want to update that for different environment.
    I have a string variable which I want to use in my application through JNDI.
    I did create environment variable in web.xml and I was able to access that in my application with JNDI name java:comp/env/roles/listOfRoles
    But I want update this JNDI variable through console.

    Hi,
    Please refer to the following Article: http://middlewaremagic.com/weblogic/?p=1809
    And the following Thread as well: Looks Big Time BUG:WebLogic 10.3  Anybody can Crash it Anytime. Beware !!!!
    WebLogic Does not provide any Option in AdminConsole to add a New JNDI Name entry. Through AdminConsole u can only see the JNDI tree.
    Thanks
    Jay SenSharma
    http://middlewaremagic.com/weblogic (Middleware Magic Is Here)

  • Set a variable in Adapter Module and read it during message mapping

    Hi guys,
    is there any way, how I could set some variable and store its value during the adapter module processing and read back this value in message mapping and use it? Without using a database or files.. I mean, some j2ee storage or something like that..
    Thanks for your help,
    Olian

    Hi guys,
    thanks for your answers..  just a clarification, what the problem is.
    I need to validate a message in the adapter module, if it's digital signature is valid. If it is, I need to send back to the sender a return code (message) OK, otherwise ERROR. I can't modify the message (or dynamic configuration) as I'm using a WSS in the sender channel. The system doesn't allow me to change anything in the message, so I can't find out in the mapping what the validation result was. I then tried to do the validation directly in the message mapping, but I have some issues there with libraries or what, because the validation code, which works in the adapter module, doesn't work in the mapping java class. So my final thought was maybe I could validate the message in the adapter module and pass the result to the message mapping and then create an appropriate return message (in the mapping). However, I see no way of passing a value there. I'm stuck and have no Idea how to resolve the problem. Any hints guys?
    Thanks a lot for your help!
    Olian

  • Set substitution variable from Sql table

    Hi guys,
    I am new to sql/unix so I hope you can guide me in the right direction.
    whats the easiest way to update an essbase subvar from a sql table?
    would I have to write a sqlplus statement to output the variable to file,
    read the file in a maxl command and set the variable and call these commands using .sh script and esscmd?
    is there a more efficient way to set the variable? e.g only use sqlplus and esscmd?
    thanks in advance,

    Try something like this
    echo off
    sqlplus -s username/passwordusername/password@server/SID:@server/SID:port @test.sql > variable.txt
    for /f "usebackq delims=" %%a in (variable.txt) do set CurrentMonth=%%a
    echo %CurrentMonth%
    See whether you are getting the correct month.
    Regards
    Celvin
    http://www.orahyplabs.com

  • I need help on setting the variables!!!!

    I'm using WinXp Pro. where should I put them in the User or System part and what goes in the Variable part and the Value part? The directions are not specific at all. Please help been on the for to many hours want to move on. I think its because of this I can't compile too. Thanks

    You should go back to the window where you set the variables and check to ensure that the changes you made were saved. You should also close any open command prompt windows and reopen them after setting variables.
    If that doesn't work, you can also try the old-fashioned way on the command line:
    set path=%path%;c:\jdk1.3.1\bin
    or
    set path=c:\windows;c:\jdk1.3.1\bin
    etc.
    If you do set your variables on the command line, you'll have to reset them each time you open a command prompt window.

  • Set Presentation variable using external Javascript?

    I want to create a user defined filter using custom java-script drop-down and wish to set a presentation variable on the dashboard. I have looked into various JS files to find the method for setting a presentation variable but have failed badly. If there is a way to set this variable please do help me out.
    thanks in advance
    ~V
    Edited by: user4555163 on Mar 9, 2011 5:42 PM

    Provide js-library you found and method for setting pres. variables and your custom js code.

  • Shell script: function doesn't set global variable when piped

    Hey there, just started to play around with some bash scripting and I bumped into this issue today.
    My code:
    #!/bin/sh
    MY_VAR=0
    echo "First: $MY_VAR"
    my_func() {
    MY_VAR=1
    my_func | grep "Fail"
    echo "Pipe: $MY_VAR"
    my_func
    echo "Func: $MY_VAR"
    Result:
    First: 0
    Pipe: 0
    Func: 1
    I assume that bash is starting a subshell to run my function when piping the result to grep. Is there any way to set the variable and pipe the output at the same time?

    Thanks, that does confirm why it doesn't work as expected. At the moment my only solution is something along the lines of:
    #!/bin/sh
    MY_VAR=0
    my_func() {
    MY_VAR=1
    #echo "Some Text"
    MY_OUTPUT="Text that I was going to echo"
    my_func
    echo $MY_OUTPUT | grep "Text"
    This sets MY_VAR to 1 as expected and I can still pipe the output to some other application but it looks awfully hackish, not to mention that it requires me to change every 'echo' to some var...
    If anyone comes up with a better solution I'll be glad to hear it.

  • Varibles and filters

    Can any one tell me the differences between variables and filters
    And also where and how r calculated key figures used and created

    Can any one tell me the differences between variables and filters
    And also where and how r calculated key figures used and created
    <b>Filters:</b> We filter the KeyFigure Values based on Characteristic Values
    Variables: These are Query POP Ups which gives the user to select dynamically there are Characteristic Varibles,Hiearchy Varible,Hiearchy Node Variable,Text Variable,Formula Variable and the Processing types are UserEntry,Replacement Path,SAP Exit,Customer Exit,Authorizations
    http://help.sap.com/saphelp_bw21c/helpdata/en/f1/0a56a7e09411d2acb90000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/9d/76563cc368b60fe10000000a114084/content.htm
    <b>Calculated Key Figures:</b> There are used for Calculations we get a new keyfigure populated based on Calculations and we can do it in Query Change mode (Local N Global) Local doesn't have technical Name Global will have technical name.
    Have a look
    http://help.sap.com/saphelp_nw04/helpdata/en/13/e072abaddb574284d22361f0b824bf/content.htm
    If Usefull assign Points

  • Pass variable and set default value based on user's group

    Hello
    I'm using SharePoint 2010 and SQL 2012. I need to send a variable to the page and based on its value, set default value for a drop down list and send it to other web part to filter the data. Is it possible for certain users to send that value as a default
    and limit user to see only this value in the text field or drop down list; for others - to allow to see the drop down list, but also set the default value for that list?
    The main page was designed in SharePoint designer, using web parts (aspx page). I had setup a connection to Active Directory and already have the code to get user's groups and based on their group, I have that variable pulled into the web page for further
    use. But I don't know how to pass that value as a default value to the web part (currently using SharePoint Filter web part). When I tried to set a default value for the web part - it automatically puts the quotation marks around the name of the variable
    and shows it as a text instead of showing the value of the field.
    Thank you!
    P.s. I have limited knowledge of SharePoint and need guidance (links, examples, recommendations)!
    Alla Sanders

    Thank you for your response. I'll try to give you more details. On PageA I check user's groups and based on the group, assign the value and pass it to the next page (no input from the user, all done behind the scene and user is redirected to PageB).
    On the next page I read that value and would like to send it to the SharePoint List Filter Web as a default value, as well as send it to another web part that displays the list from SQL, filtered using that default value. Ideally, if the user is from Group
    A, I'd like for them to have only one value in that drop down list; if user is from Group B - give him drop down list with 40 items to choose from. Below there is a part of the code and variable fnum has the value from PageA (if I print the value on the screen
    - I do see that it has correct value, so the code that gets groups from Active directory works correctly). If I assign fnum as a default value of the list, it shows "fnum" instead of the value of variable fnum. I connect to SQL database, using external
    content - so the other list that I'm filtering based on the value in that drop down list - is XSLT Data View Web part. I also have 2 more filters on that page, that user will have full access to and based on their input, it is also sent to the XSLT web part
    to filter out more data. Since one of the filters is the date and I am filtering data starting from the date that user chooses - XSLT is the only web part that I was able to make it work with.
    I looked at the link you provided (thank you). It is using Content Query Web part. Will it work with external content, as well as accepting multiple filtering, including custom starting date? I appreciate your help!
    <%
    string fnum = Request.QueryString["field1"];
    %><table cellpadding="4" cellspacing="0" border="0" style="height: 1000px">
    <tr>
    <td id="_invisibleIfEmpty" name="_invisibleIfEmpty" colspan="2" valign="top" style="height: 101px">
    <WebPartPages:WebPartZone runat="server" Title="loc:Header" ID="Header" FrameType="TitleBarOnly"><ZoneTemplate>
    <WpNs0:SpListFilterWebPart runat="server" FilterMainControlWidthPixels="0" RequireSelection="False" ExportMode="All" PartImageLarge="/_layouts/images/wp_Filter.gif" AllowHide="False" ShowEmptyValue="True" MissingAssembly="Cannot import this Web Part." AllowClose="False" ID="g_1ccc4bca_3ba1_480b_b726_adfdb1e9e02d" IsIncludedFilter="" DetailLink="" AllowRemove="False" HelpMode="Modeless" AllowEdit="True" ValueFieldGuid="fa564e0f-0c70-4ab9-b863-0177e6ddd247" IsIncluded="True" Description="Filter the contents of web parts by using a list of values from a Office SharePoint Server list." FrameState="Normal" Dir="Default" AllowZoneChange="True" AllowMinimize="False" DefaultValue="fnum" Title="Facilities List Filter" PartOrder="2" ViewGuid="2da5d8db-6b55-4403-80a8-111e42049f8b" FrameType="None" CatalogIconImageUrl="/_layouts/images/wp_Filter.gif" FilterName="Facilities List Filter" HelpLink="" PartImageSmall="/_layouts/images/wp_Filter.gif" AllowConnect="True" DescriptionFieldGuid="2d97730a-cd0d-4cb9-8b55-424951201081" ConnectionID="00000000-0000-0000-0000-000000000000" ExportControlledProperties="True" TitleIconImageUrl="/_layouts/images/wp_Filter.gif" ChromeType="None" SuppressWebPartChrome="False" IsVisible="True" ListUrl="/Lists/FacilitiesList" AllowMultipleSelections="False" ZoneID="Header" __MarkupType="vsattributemarkup" __WebPartId="{768E2035-0461-4A09-8DDD-CA7020C2B23D}" WebPart="true" Height="" Width="615px"></WpNs0:SpListFilterWebPart>
    Alla Sanders

  • Apex listener installed no test and set bind variables buttons

    I have installed Apex listener and while creating restful service module i dont see test and set bind variables buttons in the source region.
    I went through the many posts. Installed apex listener successfully.
    getting http://localhost:8080/ords/ started message when i start the listener.
    and using Apex URL as http://localhost:7780/pls/htmldb.
    What are the possibilities for this issues?
    Please help me on this.
    Thanks
    Chandran

    Apex listener version is 2.0.9
    Apex version is 4.2

  • Is it possible to export and import a set of variables?

    Hi,
    I'm using RH8 under WinXP. I use variables for our product names (=single software modules). This makes it easier to change the name, if a product name has changed. For each of these products there is a single RH-project. Now I want to import a set of variables, that I've created in one of those projects, to another project. Up to now, I haven't found an export/import option in RH for these set of variables. Is there a possibility to import/export these variables?
    Kind regards
    Stefan

    Set up a test project close it, copy the rhvariable.apj file from a project with the variables into it. Reopen the test project.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • PI Control Error Between Process Variable and Set Point

    I've developed a PI program that uses measurements from a pressure transducer as the process variable to control air pressure released from a motorized valve. The program works great at lower pressures, but as the set point pressure increases the error between the process variable and set point increases. I've tried several things....adjusting the P seems to initially increase the overshoot but the process variable always settles down below the set point....tried adjusting the EGU min and max values but no real pattern develops with this. It appears as the process variable get closer to the max EGU value of 70000 pascals the error increases.
    I've attached three screen shots showing the process variable curve and setpoint value. The graph of interest is the one in the upper right hand corner.
    Any recommendation or advice would be appreciated.
    tks, Terry
    Attachments:
    Low Pressure.JPG ‏267 KB
    High Pressure.JPG ‏398 KB
    Mid Pressure.JPG ‏266 KB

    Kyle,
    First off....I appreciate your comments. No...there is no value is system represented as U16.
    Actually errors start to develop quite a bit before the maximum. If you look at the mid pressure.jpg file you'll notice that the set point (~28125 Pascals) and process variable (~25625 Pascals) are roughly off by about 2500 Pascals. Then if you look at the high pressure.jpg file you'll notice that the set point (~53000 Pascals) and process variable (~45500 Pascals) are roughly off by about 7500 Pascals. Therefore it appears as the setpoint pressure increases towards maximum the error tends to increase.
    I was curious about something....the set point value I'm inputting into the PID.VI , shown in the high pressure.jpg file, is from EGU to percent.VI. It would look exactly like the EGU to percent VI feeding the process variable input of the PID.VI with the set point value feeding the EGU to percent.VI input. Would I be better off feeding the actual set point value to the PID.VI input instead of percentage?
    Thanks, Terry

  • How to Set up the  variables and others to compile and Run Java Programs

    Hello,
    I have just downloaded the jdk1.6.0_07 and jre1.6.0_07 and installed it in C:\Program files\Java in my Windows XP ,So please tell me how to sett up the enviroment variables etc to compile and run Java Programs from Command Prompt.
    thanks

    To set the PATH permanently, add the full path of the jdk1.6.0_<version>\bin directory to the PATH variable. Typically this full path looks something like C:\Program Files\Java\jdk1.6.0_<version>\bin. Set the PATH as follows on Microsoft Windows:
    1. Click Start > Control Panel > System on Windows XP or Start > Settings > Control Panel > System on Windows 2000.
    2. Click Advanced > Environment Variables.
    3. Add the location of bin folder of JDK installation for PATH in User Variables and System Variables. A typical value for PATH is:
    C:\Program Files\Java\jdk1.6.0_<version>\bin

  • I want to set a variable with default value and can be changed by the user

    hi,
    i want to set a variable with default value and can be changed by the user, so i new a variable with setting : customer exit, single value, optional, ready for input.
    in my customer exit code, i set a default value, eg. 20070530
    when the variable screen popup, it display the default value 20070530, i changed it to 20070529, but it doesn't work , it still display the data in 20070530, how can i solve this problem? 
    your help is appreciated.

    Liu,
       As mentioned by Anil, you need to restrict your customerr Exit code to I_STEP = 1.
    or.
       <u>Open your Variable in change mode, in the Last Page os the Variable Maintenance you can provide default value. Note: you are doing same thing in Customer Exit. In your case no need of Customer Exit.</u>
    Nagesh Ganisetti.
    Assign points if it helps.

  • Runtime.exec and setting environment variables

    Runtime.exec and setting environment variables
    I need a decent example which works on Windows.
    Got any?

    Thank you.
    I was hoping for an example of the use of
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Runti
    e.html#exec(java.lang.String,%20java.lang.String[]) or
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Runti
    e.html#exec(java.lang.String,%20java.lang.String[],%20j
    va.io.File) which take environment variable
    information such as PATH.
    The reason is because there is a library which is
    being loaded via loadLibrary (
    http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Syste
    .html#loadLibrary(java.lang.String) ). However, for
    the child process to find the library the PATH needs
    to be updated.
    Any example regarding changing the PATH variable via
    Java so that libraries can be loaded and processes
    created? (Perhaps, I should make a new post and
    restate the question with this more explicit
    information?)
    That won't work. LoadLibrary occurs in the JVM environment. As I said you can't change the JVM environment via exec().
    If the shared library needs something in the path then you are going to have to set the path before your application starts up.
    If you just need to load the library from someplace that is not on the path then you should be using System.load().

Maybe you are looking for