none
Filter for Name and Text1 not equal RRS feed

  • Question

  • Using MSP 2010 Pro.  I have a large file that I'm making simple updates.  I have send excel files out to the difference group managers for inputs.  I want to be able to track/QA that the changes have be made.  This is not long term tracking, just to verify that all the feedbacks have been made.

    My idea for the simple solution was to copy the ID field to Number1 field and copy Name over to the Text1 field. That way I have two fields to check against.

    My problem is the custom filter is not working the way I would expect it to.  I created a filter - Name does not equal Text1.  I have tried other variation but they fail also.  I would appreciate if someone would provide me some guidance.

    Steve     

    Friday, June 1, 2012 10:29 PM

Answers

  • Mrcvn,

    It may be as simple as what you entered into the Value argument for your filter. If you want to compare to a field name it must bein brackets. For example, the following works fine:

    And/Or Field Name Test Value(s)

    Text1 does not equal [Name]

    John

    • Marked as answer by Mrcvn Saturday, June 2, 2012 4:18 AM
    Saturday, June 2, 2012 2:24 AM
  • John,

    Thank you.  I re-created the filter as you suggested.  It's not the filters.  I found the problem.  It's the copy Name to Text1 process.  MSP put a leading space in front of all the copied task names.  As such, the filter was working fine.  There were no matching tasks.  I copied Text1 out to excel and did a Trim() command and pasted it back to Text1.  I also found a couple of dozen tasks in Name that have a trail space on them.  Again creating a no match condition.  I cleaned it up and it working perfect.  Appreciate your help.  I wish MSP had button to show spaces as word & excel has.

    Steve   

    • Marked as answer by Mrcvn Saturday, June 2, 2012 4:19 AM
    Saturday, June 2, 2012 4:18 AM

All replies

  • Mrcvn,

    It may be as simple as what you entered into the Value argument for your filter. If you want to compare to a field name it must bein brackets. For example, the following works fine:

    And/Or Field Name Test Value(s)

    Text1 does not equal [Name]

    John

    • Marked as answer by Mrcvn Saturday, June 2, 2012 4:18 AM
    Saturday, June 2, 2012 2:24 AM
  • John,

    Thank you.  I re-created the filter as you suggested.  It's not the filters.  I found the problem.  It's the copy Name to Text1 process.  MSP put a leading space in front of all the copied task names.  As such, the filter was working fine.  There were no matching tasks.  I copied Text1 out to excel and did a Trim() command and pasted it back to Text1.  I also found a couple of dozen tasks in Name that have a trail space on them.  Again creating a no match condition.  I cleaned it up and it working perfect.  Appreciate your help.  I wish MSP had button to show spaces as word & excel has.

    Steve   

    • Marked as answer by Mrcvn Saturday, June 2, 2012 4:19 AM
    Saturday, June 2, 2012 4:18 AM
  • Steve,

    You're welcome and thanks for the feedback.

    Just for reference, Project does NOT add leading spaces on its own. Something else must have happened to cause that to occur in your case. Same thing with trailing spaces. The latter is normally due to inadvertent hitting the space bar as the user types in the task name.

    John

    Sunday, June 3, 2012 2:54 AM
  • John,

    My version of Microsoft Project 2010 (14.0.6023.1000) SP1 MSO (14.0.6112.5000) does put a leading space character (could be an invisable program character that appears as a space) in front of all task names. 

    I just reverified it four ways.  Using Text17, Text18, Text19 and Text20.  (1) First selecting Name title which highlights all tasks and using the copy button to paste.  (2) Then manually selecting all the tasks themselves using the copy button.  Repeating the same (just to see if there was a difference) but using the keyboard Ctrl-C and Ctrl-V.  Everything copied over with leading spaces EXCEPT task 1, Tasks 2 and below had a leading space.  Note, Task 2 and below are indented for WBS.  The file has some tasks down to the forth level.

    If I copy individually selected tasks that are on the same indent level it copies them clean.  If there is a summary task included the leading space re-appears in the Text field.

    I would never had seen the leading space or paid attention to it.  I was tunnel focused on why the simple filter was not working.  Thanks for the help.

    Steve

    Sunday, June 3, 2012 2:26 PM
  • Steve,

    Okay, I stand partially corrected. Here is why you are getting the extra space. Go to File/Options/Advanced group. In the display option for this project you will note that the option to Add space before label is unchecked. Check that and your extra leading space will not occur when you copy and paste.

    Something else I forgot to mention. Comparing text strings with an absolute test such as "is equal to" is always tenuous at best. Things like inadvertent spaces, misspelling or even capitalized versus non-capitalized can cause the test to fail. It is much better to use a test like "contains", although that can also sometimes give unintended results.

    In an earlier response you mentioned that you cleared rogue trailing spaces by copying the text to Excel and applying the trim function. You could have done the same thing with a simple macro using the Trim function. For example, the following code will copy the name to the Text1 field while removing leading and trailing spaces, if they exist, no need to worry about the option setting mentioned above.

    Sub copytxt()
    Dim t As Task
    For Each t In ActiveProject.Tasks
        If Not t Is Nothing Then
            t.Text1 = Trim(t.Name)
        End If
    Next t
    End Sub

    John

    Sunday, June 3, 2012 3:18 PM
  • John,

    Thanks for the Macro suggestion...  Very sweet and clean.  No rogue spaces or leading spaces.  Can you use the Trim() function directly on the Name field for cleanup work?  Such as using the above macro changing "t.Text1 = Trim(t.Name)" to "t.Name = Trim(t.Name) or will that cause trouble?

    As for the "Add space before label", mine was checked.  I have tried it both checked and unchecked doing the simple copy/paste function.  In both cases it still places a leading space on all subtasks if a summary task is in the selected copy grouping.  Only the top level summary does not have a leading space.  (FYI - The "Show project_summary task" is unchecked, on this file I don't use it.)

    Steve

    Sunday, June 3, 2012 4:34 PM
  • Steve,

    Interesting. I just did a couple tests and yes for some strange Project reason, if you select the whole Name field column, copy and then paste into the whole Text1 field, a "rogue" space gets stuck in front of the name regardless of whether the option is checked or not. However, if you only copy the subtasks (i.e. no summary lines) and paste, the rogue leading spaces don't occur. I have absolutely no explanation but then there are a whole lot of little quirks in Project (especially 2010) that defy logical explanation.

    The obvious "solution" to this quirk is to apply a filter for no summary lines (i.e. Summary equals "no") and then do a copy and paste of the whole column. To get the summary line names copied, apply the built-in Summary Tasks filter and do the same copy and paste. It's called "working the system".

    With regard to your question about modifying the macro to clean up the Name field. Certainly, it will eliminate leading and trailing spaces if they exist. It will not however change the above quirk.

    Sorry for some of my earlier misguidance. I learn something new about Project 2010 nearly every day.

    John

    Sunday, June 3, 2012 8:10 PM
  • John, again thank you!  I sincerely appreciate you taking time to work with me and confirming my results.  It is what it is, quirk or feature, depending on how you want to use it.  LOL  Have a wonder day.

    Steve

    Sunday, June 3, 2012 8:38 PM