Adding values of mulitple tables in a loop with if then statement

So I a table set in place and need to add the hours of specific activities.

I have Activity() as an array of drop-down boxes with things like ' holiday, regular, vacation, etc.

Monday(), Tuesday() etc., are numeric field berries.

and I try totals of population since the differnet activities.

Use of Java like this and it doesn't seem to work:

for (var i = 0; i < 12; i ++)

{

If (activity [i] .rawValue = 'Holiday') {}

$. Monday = value [i] .value + Tuesday [i] .value + Wednesday [i] .value + Thursday [i] .value Friday [i] .value

}

}

Am I missing something here?

Hello

Use FormCalc (not JavaScript). I think that you have a 'total' field for each week (i.e. total and Monday are brothers and sisters?). If so

//////////////////////////////////////////////////////////////////////

If ( == 'Holiday' activity) can

$ = Sum (Monday, Tuesday, Wednesday, Thursday, Friday)

on the other

$ = 0

endif

//////////////////////////////////////////////////////////////////////

If you are adding up for several weeks (weekly).

If (activity == 'Holiday') then

$ = Sum (Monday, Tuesday, Wednesday, week [*] [*] the week of the week [*] [*] the week.) Thursday, the week [*]. Friday)

on the other

$ = 0

endif

where each group of days is encapsulated in a subform named "week".

//////////////////////////////////////////////////////////////////////

Finally, it uses the values "boundItem" NOT the displayed value. So:

If ( == 'Holiday' activity) can

works only if the value of boundItem is used. Look in the BindingTab for the drop-down list to understand and configure certain boundItem values. They are strings and use "" when you reference strings. So 1 is better referenced as '1' as in

If ( == activity '1') then

//////////////////////////////////////////////////////////////////////

Finally, if needed of statements == (do not use a single =).

I hope this helps!

Stephen

Tags: Adobe LiveCycle

Similar Questions

  • Problem adding values to a table with the state machine architecture

    Hello

    I currently have a problem that I have to build a program using state machine architecture and now I want to add a value in a table whenever you press a button, but I would like the table to add the new value, rather than deleting the last value. I can't seem to figure out how to make this work without using while loops and similar. It doesn't seem to work properly.

    It is in the case of measurement.

    The idea is I draw several lines then it records the length of the lines in a table and then I'll take one average this so I can convert pixels into real life SO units. But right now I can't seem to add the information in the table.

    There is a little screw Sub, but I think that they should not be important for this question please!

    What's the problem with just the table help build?

  • Update a table in a loop with a table, not a single value

    Hey everybody,

    I'm new to the Forum, but I do LabVIEW for almost a year now.  I work to make my code much more simple, but I encountered a problem that I can't seem to overcome.

    Say I want to graph a numeric control.  I'm updating the digital control to 5 and 5 graphic updates.  Whenever my loop is executed, the 5 is reloti.  Easy to see that the updates fast loop, my FP will have too much processing time.  How to pass control to an array and only draw table each, for example, 10 iterations of the While loop?  I thought using the 'i' in the While loop and a structure case (use is equal to? 10 as the true to update case).  That doesn't really seem to be the answer... Any help is appreciated.

    Hi, Mr. Bass,.

    Thank you for your post and welcome to the forums of NOR.

    If you want to update every 10 iterations, for example, you can use "Quotient and remainder" LabVIEW function found in the palette of the digital - divide the number of iteration by 10 and check the rest, if it is equal to zero then you're on the 10th, 20th, 30th, etc the iteration. You can then use a case structure and write your chart in the case of true, with the condition is true, if the remainder is zero.

    Let me know how you go with this method.

    Thank you

  • Adding values to a table in a State Machine

    I'm building a VI that control several instruments and then takes data from these measures and applies them to the calculations appropriate to the materials science, such as the resistivity and Seebeck effect. I created a state machine that establishes a level of tension and takes three sets of three different measuring points, using a scanner Keithley 7001 and nanovoltmeter Keithley 2182. I'm now trying to find a way to take action and put them in three separate tables so that I can use them for analysis later. I prefer the tables because there are several screws that can help me to do what I have to do easily (for example, the VI means), but if something works better, I am open for entry.

    My simple question: what is the best way to take measurements of the case 1 SOUL, SOUL 2 and 3 soul and store them in three separate tables?

    I enclose my VI.

    Edit: Just after the announcement, I decided that I will take the structures of sequence holding the sections measure and instead turn them into business within the state machine. I'll post a new VI of the present when I finished.

    In this example, I used a structure called soul #. This structure allows each soul to have its own unique array.

    The structure is an array of clusters. The cluster contains a string array named Data.

    I hope this helps.

  • Need an example of loop with sql statement in shell script values

    Hello

    I have to present a simultaneous program to each line of the table through script shell (only).

    The table has all the parameters required to pass to the concurrent program.

    I have trouble in a loop with the lines of sql statement results.

    Could someone give me an example of a shell script with a loop with the sql statement values.

    appreciate your time and your help.

    Thank you

    Ganesh

    Hello

    Here is a guide using 3 parameters:

    {

    sqlplus-s $OA_USR / $OA_PWD<>

    SET THE OFF POSITION;

    SET FEEDBACK OFF;

    SET LINESIZE 300;

    SELECT param1, param2, param3

    Of your_param_table;

    ENDOFSQL

    } | while reading line

    do

    If ['$line'] # line non-NULL

    then

    set $line

    param1 = "$1."

    param2 = "$2."

    param3 = "$3."

    # Pass parameters to a script, sql more

    sqlplus-s $apps_usr / $apps_pwd @SUBMIT_CONC_PROG.sql $param1 $param2 $param3

    FI

    fact

    }

    In your SQL * more script you run 3 parameters into variables:

    declare

    VARCHAR2 (10) param1: = ' & &1';

    VARCHAR2 (10) param2: = ' & &2';

    param3 varchar2 (10): = ' & &3';

    .....

  • Setting the value of a table of ActiveX control

    When controling a VI through ActiveX, how is possible to set the value of a table control?

    With digital controls, I have a problem: I just use SetControlValue and it works well:

    til SetControlValue ('y', 4) for example.

    However, in trying to do the same thing with a table, the control's value becomes an empty array:

    til SetControlValue ("arr', [3-4-5]") for example.

    What is the right way to do it?

    Hi Calvin,

    Have you tried passing a string and convert it to an array entry?  You can also try to use a 'matrix' control, rather than a table, as they are handled a little differently.

  • How to build a table inside a loop

    Hello world

    I have a fundamental question on labview. I would like to create a table in a loop 'for' in this way:

    inside the loop, if a condition named 'A' is true, then I add a new value to the first column of the table.  Otherwise, I have create a new column and start adding values in this column when the condition 'A' is checked, etc.

    I put an example of a VI when the 'A' condition is "improving the loop + 1 is not divisible by 5" and the values in the tables are to increase the loop + 1. The loop stops when the increment = 25.

    In this example, I have a single column with the values [1 2 3 4 6 7 8 9 11 12 13 14 16 17 18 19 21 22 23 24]

    while I wish I had a table of 5 columns:

    1 6 11 16 21

    2 7 12 17 22

    3 8 13 18 23

    4 9 14 19 24

    Note that this is just an example. More generally, the table may contain columns of different lengths.

    Thanks for your response

    Andrew

    Try to watch this VI I wrote, it takes a 1 d array and puts it into a 2D array based on a threshold. I think it's a pretty good example on how to insert a table of works. I hope it helps

  • Adding items in a table

    Hello guys, I looked for a solution to my problem, but I can not find the correct answer...

    Here's the thing;

    I have a variable (let's call it 'Variable Case'). Whenever this variable goes from 0 to 1, I want to add to the value of another variable (let's call this a "Defective nozzle") to an array of 2D. So far, nothing impressive, but things will get worse now!
    To be sure I added correctly the value of "Defective nozzle" in my table, I have another variable (let's call it 'Successfully added') which goes from 0 (Nothing) to 1 (the value added in the table). When 'Successfully added' is '1', I have to set the value of 'Box' return from 1 to 0 (the 'Case' variable is in a while loop which is refreshed every 100 ms so it is very important that "The case" goes to 0 as soon as 'Defective nozzle' writing is done) and once the 'case' is 0 , the value 'Successfully added' aswell 0.
    In addition, the size of the array is set to 10 items and whenever a value is written in this document, I have to increment the value of the index for the next value.

    How to understand;

    First iteration:

    • I have (from table) = 0

    • Business goes from 0 to 1

    • I insert the "Defective nozzle" value in the table

    • "Successfully added" goes from 0 to 1 (the value was written in the table)

    • I put back 'Case' to 0

    • I (index table) ++

    • 'Successfully added' move to '0 '.

    Second iteration:

    • I have (from table) = 1

    • Business goes from 0 to 1

    • I insert the "Defective nozzle" value in the table

    • "Successfully added" goes from 0 to 1 (the value was written in the table)

    • I put back 'Case' to 0

    • I (index table) ++

    • 'Successfully added' move to '0 '.

    Third generation (you have the thing...)

    I have everything works but the "I ++" thingy. Could you take a look at my vi and tell me what I'm doing wrong? Thanks for your help!

    Hello Claude,.

    meaning of GerdW, is, that you don't find the answers to many questions.

    1. Due to the paradigm of data flow of LabVIEW, independent (and not with the wire) parts of the diagram run in parallel. If the sequence you have described in your message will run not in your VI, because the structure of the case, the structure of the event and the select node are independent of each other. You see, if you perform the VI mode with the debugging light bulb on.

    2. Shared variables are not the best way to store values, except that you want to share these values with other applications on remote computers. The best way to pass values from one part of the block diagram to another is a thread!

    3. "Change the value" - event fires only if the value is passed to the user interface, this means only by the user or through the 'value (signalling)' property node. So in your VI this event never fires. And because the terminal timeout is not wired, the structure of the event you expected forever to run your loop don't cycle.

    4. The part with the select node is already described in the Rube Goldberg-Thread, this means: If TRUE then TRUE else FALSE

    I modified your VI so that he could answer some of your needs. Have a look at it and maybe you can answer the questions that came up to me:

    1. Why "table initialized" a 2D array and to what index elements must be inserted?

    2. Why 'table initialized' limited to 5 rows and 2 columns, and what happens when you want to insert multiple items? You can start again by the index 0? Do the loop terminate?

    3. If you want an unlimited size of the "initialized array", you must use the node 'build array' instead of 'subset of table to replace.

  • The delay between the "successfully added" definition affecting the value TRUE and FALSE reset is very short (about 10 ns), do you really need this information?
  • For some reason, I'm not able to view a VI. I get the message error that the extension doesn't ' corresponds to the file type.

  • maximum values of five table 2d

    Hi, I have a vi that reads in the values of a 2D array, and then uses this information. I currently use the vi 'Table Max and Min' to find the maximum values of the table. It can be beneficial for my application find the maximum of 5 or any other number of values in the table. My current plan is to use a loop that detects that the maximum value of the original array and then subtract this value and repeat the operation once 5 or greater. However, I believe that it is innefficient and can take a long time in a vi that must run pretty quickly. I would like suggestions. Thanks in advance.

    It would be a bit faster

    After overhaul at 1 d

    Sort the table (from the smallest to largest)

    Turn the tide (the biggest to the smallest now

    Get the highest values since the beginning

  • Build a table of a loop for.

    Hi all

    I have a vi that reads from a file and manipulates data using the loop. I'm taking each element and multiplying by a constant and convert it to I32. I would build to a new array with the new values. I have attached the vi and a sample data file to read.

    Please suggest if there are the best ways to do this.

    Thank you.

    You can multiply with the constant table and use table instead of multiply with each item.

  • Find a value in a table

    Hi, I'm trying to find the index of a value in a table, I know that it is a VI called 'research in a 1 d table' but there is my problem: Let's say I'm looking the value 25 and in my series of measurement, there like 24.998 and 25.001 but not 25, this VI will not find the value 25 although he went close enough , so basically I try to inplanta a tolerance system making it able to find with precision +-3 or 4 on the index, doing someone something for this?

    Thanks for your time

    I wrote this for a similar job, but it could be used for your application.  Just use the vi attached in a loop to check "in range" and returns the index of the loop of the first occurrence.

    Hope this helps

    Ken

  • insert into the table using the loop and permanently display

    Hello

    I am trying to insert some values of loop loop run into two tables and trying to draw using Graph XY. I need values Joanie be inserted one by one in each iteration. But at the end of the iteration in the table, I get only last value... can someone help me?

    Hello Manu,

    use a shift register to store each table. BuildArray allows to add/Add (not Insert!) of new values in the table.

    Then you need not use an ExpressVI to create the chart, a knot simple bundle (as indicated in the context-sensitive help) is enough to create a field in a XY Chart...

    Example with a table:

    Keep in mind:

    It's not (memory/CPU time) effective to use for time of data acquisition time (giving rise to large Bay). Use different approaches then...

  • Permanently add values in a table then VI run

    I currently have a situtaion where I get a number of numerical values on a single line I need to store in a table. This has to be done during the execution of the program. I know that I can use the 'Build table function' but the word really sure I'd need some time loop with shift registers or a feedback node. Any suggestions on what would be the best way to implement this?

    After some people on this forum have done test (because they had the same question),

    The shift register is about 4 times faster than that of the feedback node.
    But in terms of functionality, they are identical.

  • acquire a signal and the rms value in a table every second

    Hello everyone,

    Sorry, but I am known in the world of LabView and I'm going crazy because I can't understand how to do a simple thing (or what it tends to be in my mind).

    As said by the object,
    my wish is to acquire a digital (a through the DAQmx) continuous (it's ok for this part), get the RMS (or average) of such acquired signal (thanks to the Amplitude and levels of measurement, for example) and put the value in a table (1 d); and, every second.

    In one sentence: acquire a signal, the average value, put in a table, and then restart each second. In the end, for example, the program for 1 minutes gives me 60 value in the table.

    Is someone can help me?

    Thank you in advance.

    Viviogs.

    First of all, I'm not sure that you can be sure exactly a second measurement using this technique.  If the precise timing is important, I think that you need a timed loop.

    That said, if the only problem you have is how to write the table indexed in a spreadsheet, you just need to use "Write in the worksheet file."  See here.

  • Table and the loop problems (please help)

    Im making a site for a project where I have to include a table and a loop.

    For this section, I put in a "contact us / Q and A" page where the user can enter a name, email, and question.
    This information is sent to a table and then following image shows the form of the table information in the dynamic text boxes.

    I've included a loop to check that each part of the table contains data (name, email and the issue).
    Then I have an If Else, which clears the form either if a section has been missed, OR if the form was completely correctly it directs the user to the frame following where as I said above the details appear in dynamic text boxes.

    The problem im having is the loop to check For the table that's a waste. Someone can please help me out here and get the loop to verify that all fields have been filled.

    Here is my code for the initial frame

    You must update the values in your table at the time you press the submit button. Code follows

    There is a second example to check the strings (it's a little complicated, but it's a useful trick if you can understand). This does not leave the Send button work unless all fields have something in them

Maybe you are looking for

  • Computer laptop screen flashes

    Hello. My laptop screen started blinking last night and it jumps between desktop screens and start. Also, the icons on the taskbar disappear and reappear when it flashes. I see that others have had this problem on another thread, but it does not rese

  • Network wusb300n wireless adapter creates test.txt on my C drive

    Hello. The software of network WUSB300N wireless adapter/monitor creates the file test.txt on my C drive. This file is required, and if not, how can I stop this generated file? Thank you.

  • Wallpaper (wallpaper) keeps extending from any position I click

    When I got to my laptop (Vista Ultimate) the great horizons has worked, but suddenly it has stopped allowing me to change my wallpaper position no matter what I click. The images are still tense even if they are small images and larger pictures are c

  • How to install the driver

    My Windows it think authentic nots and told me that something was wrong with my driver from intel and has been given https://downloadcenter.intel.com/product/55005/Intel-Rapid-Storage-Technology-Intel-RST- link but what I get from the installation wh

  • Halo 2 Vista: Error has occurred.

    I studied all the possible ways to play Halo 2 Vista on my Windows 7 laptop. All have failed. The error I get is: LIVE gaming on Windows failed to initialize. Maybe it's because an another LIVE Gaming on Windows application (for example the dedicated