5 Replies Latest reply: May 15, 2014 10:02 AM by Grant Perkins RSS

    Populate a Calculated Lookup Field

    rlandeo _

      Hey all,,,

       

      I have a few fields in my table that I want to clear the contents of whatever is in them and populate them with either a blank space, the letter Y, or 000000000 defined as text.  I'm thinking that the best way to go about this is to create a calculated lookup field, point the input field at some field where no matches will come up, and specifically define my output value to be what I want it.  After that, I'll hide the original fields.  I'm currently doing this in Excel, then bringing it back into Monarch, but I would like to do everything from just one program.  Anyone have any critique or maybe a better way to go about this?  Thanks.

        • Populate a Calculated Lookup Field
          Grant Perkins

          Have you thought about a runtime parameter or a user entered field?

           

          Why capture a field you are not going to use for its original purpose?

           

           

          Grant

            • Populate a Calculated Lookup Field
              rlandeo _

              Have you thought about a runtime parameter or a user entered field?

               

              Why capture a field you are not going to use for its original purpose?

               

               

              Grant[/QUOTE]

              I tried a runtime parameter and it worked perfectly.  Thanks.

               

              I'm capturing those fields because 2 of them are filler fields that I need to contain 1 blank space, and the last field I'm capturing, because it needs to be zeroed out.  Now that I found out how to create and populate a field, I guess I can get away from capturing them and just create new fields.  The end result has to be a fixed-width ASCII file and every field has a position that I need to be at so it can be used.

                • Populate a Calculated Lookup Field
                  Grant Perkins

                  Raul,

                   

                  I have had the same requirements over the years. Any way of creating the fields will do! Saving in the registry between runs can be handy as well.

                   

                  To get the size and positioning as you require  - have you discovered the Field List feature? If you know the order required and the sizes of the fields it can be quicker to create those in any order they come and then fine tune with the Field List which is available from the drop down menu associated with most screens.

                   

                  HTH.

                   

                   

                  Grant

                    • Populate a Calculated Lookup Field
                      rlandeo _

                      Raul,

                       

                      I have had the same requirements over the years. Any way of creating the fields will do! Saving in the registry between runs can be handy as well.

                       

                      To get the size and positioning as you require  - have you discovered the Field List feature? If you know the order required and the sizes of the fields it can be quicker to create those in any order they come and then fine tune with the Field List which is available from the drop down menu associated with most screens.

                       

                      HTH.

                       

                       

                      Grant[/QUOTE]

                      Yes, I have been using the Field List to change a few fields from numeric to character and also to adjust the template when I just can't seem to capture the last bit of data when I create a template.  I guess I could adjust the adjacent fields to be wider than they should be to bring in that whitespace and still have them line up to the position where they are suppose to be at.

                       

                      I saw that option to save a value in the registry between runs, but not any documentation on what exactly that does.  Would you mind explaining that part?

                        • Populate a Calculated Lookup Field
                          Grant Perkins

                          Yes, I have been using the Field List to change a few fields from numeric to character and also to adjust the template when I just can't seem to capture the last bit of data when I create a template. I guess I could adjust the adjacent fields to be wider than they should be to bring in that whitespace and still have them line up to the position where they are suppose to be at.[/quote]

                           

                          It is by far the easiest way to make adjustment fo the starting positions of fields if such a thing is required. The template definintion 'nudge' feature is also very good but the Field List can be quicker unless you need the visual aspect to see how everything fits together. Fields list is the wat to go if you are working from and to a detailed specification.

                           

                           

                          I saw that option to save a value in the registry between runs, but not any documentation on what exactly that does. Would you mind explaining that part?[/quote]

                           

                          If you use the save between runs it will default to the same value next time the model is used. If you say no it will present as a blank field each time. If you say no and set the required entry flag the user must enter something that is valid for the type of field.

                           

                          So for your examples you could set the fields to be "Y" and the zero fill to prompt the user for those values each time but allow an override should one be required. Probably best used where you are using the same model for different purposes and the values required there are variable. Also very useful for filtering.

                           

                          If you just need the fields to exist and the will ALWAYS be blank or Y or zeros it may be easier to create calculated fields that are always created with those fills. There is no need to make them in the templates, just add them as fields in the table and set the value you require as the "formula". ( e.g.   "Y"  )

                           

                           

                          HTH.

                           

                           

                          Grant