Where-Object Question

I'm trying to filter out some data in a csv flie I'm reading to generate another file but I can't seem to get my where to work.
In a nut shell, I want to select all users that are missing some pieces of data (an email address and a manger) but for some user types (students and residents) I want to filter them out (even though they are missing a manager, if they have an
e-mail address I want it filtered out)
This is what I tried but it didn't work and they more I look at it the more I think I have the logic wrong but I'm just stumped. I've spent a few hours on it now.
Import-CSV -Path $inputFile | where { ($_.email -lt "*" -or $_.manager -lt "*" ) -and ($_.usertype -notlike "*student*" -or $_.usertype -notlike "*resident*") -and $_.email -gt "*" ) } | select $userAttributes | export-csv $outputPath
I also tried doing like a sub-query importing the users I want filtered out into an array and then doing a -notcontains but that didn't work either.
$filterOut = Import-Csv -Path $inputFile | where { ($_.userType -like "*Student*" -or $_.userType -like "*Resident*") -and $_.email -gt "*" } | select person_id
Import-CSV -Path $inputFile | where { ($_.email -lt "*" -or $_.manager -lt "*" ) -and $filterOut -notcontains $_.person_id } | select $userAttributes | export-csv $outputPath
Any ideas? Thanks for the help.

Thanks all for the suggestions. To clarify:
I have two queries that use the same input file (they generate two different reports that are saved to csv files).
1. Pulls a list of users where values in certain fields are not null, for this query I'm using -gt "*" and that seems to work - but it sounds like I can just use $_.value from what you described above to factor out the nulls?
2. (This is the one I'm having problems with) I want to return a list of users that are missing a
manager and an email address (this is where I was using -lt "*" to say if this is null, select it. It was the only way with my knowledge I could get this to work) but there is an exception to this condition. If the user is a
student or resident and they are missing a manager value
but have an email
then exclude them from the report. However, if the student/resident
is missing both the manager and email values then they need to be included in the report.
Does this additional context help?
Thanks all for your help.

Similar Messages

  • Wana XI objective questions

    Hi all,
    any body wants XI certification objective questions I have some that please contact me on personal mail id
    [removed by moderator]
    I will forward that doc.
    Thanks & Regards,
    Ashok Kumar.M
    Selling certification questions is illegal and point mongering for them is not a respected community activity - [by moderator]

    Hi Ashok,
    SAP SDN is a devloper forum where Professional Developers all around the world discuss their issues and share knowledge among themselves for any support.
    Please dont post this type of questions on this forum in near future for any personal gains.
    Thanks
    Prasad

  • Objective question book for certification

    Hi,
    I was preparing for my first level certification CLAD. I wanted to know if there is any book on the objective questions . I have already cleared the fundamental test at ni.com. I am looking for more practise.
    Anyone who has given the test or plan to give one, please post some ways of preparing for the exam.
    Also how hard it is ?
    Any special tips for 2006 exam?
    Any help would be greatly appreciated.
    I am preparing for the exam by reading basic I and Basic II books.
    I have given couple of fundamental tests on the NI website.
    Also I keep reading and answering  NI discussion posts to check on my knowledge about Labview.
    Any other material that would be helpful in clearing the exam.
    Also according to certification FAQs the passing percentage is 70% whereas the fundamental test results will declare you Pass only when you score more than 80 %.
    What is actually the passing percentage for the exam?
    Regards
    CLAD
    Using Labview 5.1,6.1,7.1.8.0

    Passing the test myself you are required by NI not to disclose any information so where do I start?  If you have been using LabVIEW for at least a year you should be fine.  The test is constantly changing so even if I were to tell you what to study it may be all different.  I guess the best advice would be able to inspect code without running it and know what LabVIEW result will be.  If you are comfortable with loops and shift registers and understand what the result of the code wold be then you should do OK.  I know the questions was what books would help the most.  I just looked at the LabVIEW manual and managed to do fine.  Another tip would to be study the things that you typically don't use or how it is implemented.  A book will help you to a point but you need to be comfortable with LabVIEW and its wide functionality.
    Does this help?
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison

  • The email where security questions are being sent is invalid.  How do I change it

    The email where security questions are being sent is invalid.  How do I change it. 

    You cannot change your Rescue email address after you have forgotten your Security Questions. Once you get everything reset, you will be able to change it. For now, you are going to have to contact Apple Support to get them reset:
    ACCOUNT SECURITY CONTACT NUMBERS
    Cheers,
    GB

  • Where-Object filtering using an array

    Greetings! Trying to use Where-Object to filter out the returned data from Get-ChildItem. I essentially want to include everything that matches "Microsoft Lync Server". This works fine for matching "Microsoft Lync Server", but I can't
    seem to figure out the syntax to exclude those that match anything in the array.
    $filter = @("Debugging Tools","Resource Kit Tools","Best Practices Analyzer","Meeting Room Portal")
    (Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object {$_.DisplayName -imatch "Microsoft Lync Server"}) | Select-Object DisplayVersion,displayname | Sort-Object DisplayVersion -Descending
    I've tried using something like
    (Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall | ForEach-Object {Get-ItemProperty $_.pspath} | Where-Object {$_.DisplayName -imatch "Microsoft Lync Server" -and $_.DisplayName -notin $filter}) | Select-Object DisplayVersion,displayname | Sort-Object DisplayVersion -Descending
    As well as -notcontains -notmatch, etc. to no avail. Ideas?

    Not quite. The requirement is to list ALL with a display name that includes "Microsoft Lync Server" EXCEPT those in the filter. Your first example gave JUST the stuff in the filter. Changing it to -inotmatch now shows EVERYTHING (including stuff other than
    "Microsoft Lync Server") except what's in the filter. But, I was able to adapt it to:
    $filter = @("Debugging Tools","Resource Kit Tools","Best Practices Analyzer","Meeting Room Portal")
    [regex]$regex = ‘(‘ + (($filter |foreach {[regex]::escape($_)}) –join “|”) + ‘)’
    (Get-ChildItem HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall |
    ForEach-Object {Get-ItemProperty $_.pspath} |
    Where-Object {$_.DisplayName -imatch "Microsoft Lync Server" -and $_.DisplayName -inotmatch $regex}) |
    Select-Object DisplayVersion,displayname |
    Sort-Object DisplayVersion -Descending
    Thanks for the info, as it kept most of my original syntax, and wasn't full of aliases.

  • BOMM - metadata manager repository sql to fetch where object is used in rep

    Hi,
    We've been using BOMM for a few months and would now like to make our own reporting on the BOMM repository. Most information we're capable of retrieving, but not wether a certain universe object is used in the select-clause or where-clause of a reportquery. The information must be stored somewhere, because the mm explorer is can give us that information.
    Can someone tell me where this information is stored and how we can get it out?
    I thought it was stored in the table MMD_Query, with query_type_cd = sqls or sqlw. But the table only contains the full sql (sqlf), universe contexts (unvc) and join statements (sqlj).
    Thanks in advance for the help. Regards
    Guy
    Ps: My excuses for the crossposting, but I was advised to put this question in this forum.

    You might have better luck in the (somewhat misnamed) [Data Integration and Data Quality Management|Data Services and Data Quality; forum:
    This forum is dedicated to topics related to SAP BusinessObjects Data Services (Data Integrator, Data Quality Management, Text Data Processing), SAP BusinessObjects Information Steward (Metadata Management, Data Insight), SAP BusinessObjects Rapid Marts and SAP BusinessObjects Data Federator.
    (emphasis added)
    Regards,
    Sean

  • ADF View objects question

    Hello,
    I created a view object (which bases on an entity object) that I'd like to use for searching for records in a table called "CARS". Cars will be searched by names. I also have a JSP page for adding cars (administration functionality).
    The situation is as follows:
    1. I go to the page for adding cars and click "Submit" (which only submits data without committing to the database).
    2. Then I have validation errors (which is ok because some fields are mandatory).
    3. I search for cars by name.
    The funny part is that if I search for cars with given names, I get those cars AND I get the empty row with this new car I'd tried to add just a moment ago. It's definitely not yet in the database and the name of this car is not set (so it shouldn't match with the name I'm searching for).
    My question is: why is it happening and what should I do to get the rows created but not yet committed not appear in the search results?
    I tried to use clearCache() method of ViewObjectImpl but the result is still the same.
    Please help because I desperately need this for my diploma project.
    Thanks,
    Anna

    I run: "java -Djbo.viewlink.consistent=false -jar oc4j.jar" and I still get new rows. I'm using OC4J 10g (9.0.4.0.0) standalone that comes with JDeveloper 10g (9.0.5.2) on Linux.
    And about that Create pages: I mean I click on a link "New something" 3 times (for example). I don't use the browser back button because I have my menu on each page. In this case I'm just curious if it's possible to somehow "overwrite" previous "new" rows with the most recent one.
    I thought I would need that but now I know I need something else.
    Imagine such a situation:
    1. A user wants to create a new row or update an existing one.
    2. They start filling the form and submit it (in my case it's committing at the same time)
    3. During validation it turns out that some required values are missing so the user has to enter them.
    4. At this point the user leaves the input form and decides to add or update a different row.
    5. The user enters all the required values and this time validation would succeed. However, because of points 2. and 3. it does not.
    Now my question is: how can I make ADF somehow "forget" about the row inserted/updated in point 2. I know that ADF validates all new/changed rows at a time. But I would like to change that behavior so that it would validate only the row changed/created most recently.
    Thanks,
    Anna

  • Oracle Apps Objective question and answers

    Hi all,
    We need Oracle Apps(DBA, Tech & Funct) objective type questions with answer.
    Can you any one help to find the questions. Even if they are any links, dumps, doc please post them.
    Thanks,
    Ramaraju.

    HI Ramaraju,
    You can search for FAQ related to topics like adpatch, cloning etc etc
    Google should be your friend
    for DBA check this out its the best book
    Cracking the Oracle Apps DBA Interview: 325 Frequently Asked Questions  – June 12, 2009
    by Joyjeet Banerjee (Author)
    for technical
    http://oracleappstech12.blogspot.com/2012/08/oracle-apps-technical-interview.html
    Oracle Apps Technical Interview Questions, Answers for Freshers and Experienced asked in Job Interviews
    http://oracleapps4u.blogspot.com/2011/07/oracle-apps-interview-questions-and.html
    etc etc
    well for functional it depends on the module
    I'm not aware  of  any dump which covers all (administration, technical and functional )  of them so you need to Google as per the module for functional
    ApPsMaStI
    sharing is Caring

  • Web Service Object Questions

    Hello;
    I believe I may be using improper terminology but I will try to explain as best as I can.
    I have been working on a web service form, with 2 methods. One is a get, where I put in parameters and it returns a result. Another is a form to input data into a database app.
    The get method has two routines, a validation of parameters (essentially a login) and the results object. The validation is able to be dragged onto the form, it appears completely and works perfectly. However; the results object cannot be dragged onto the form, it appears in design (as a subform) but will not display on the .pdf. Additionally; it contains only one segment of the data it is supposed to return. It would contain approximately 100 records, but only returns the first. If I drag each field onto the form separately, it comes in and appears on the .pdf. I can get it to work by copying the 4 fields repeatedly, and when I process the validation the additional records populate the copies. This is tedious work and I have forms for multiple services to design. I just wish I could drag the whole object and have the results display as a table with each row as a record.
    The input form has the same validation and approximately 30 fields for input, I have the same problem where dragging the entire method (creates a subform) doesn't display on the .pdf. Once again I can individually drag each field but it doesn't seen might that it appears in design but won't appear on the .pdf.
    Yes, they are set as visible, and they are already at the front of the form...
    Any help or suggestions are greatly appreciated
    -Tim

    Thanks for your help, I have a much greter understanding of subforms as a result. Your suggestions seem logical and I can understand how designer should work (flow,repeat,fill parent...)if I could get it to behave.
    Howerver, I cannot seem to get it to work right. The method has 4 levels in the hierarchy.
    Method; Body>Response>Result>Objects(fields that will repeat)
    I have tried every combination of settings, and I can only get it to work if I copy the individual fields over and over and make sure they are not contained in any subform. I have tried unwrapping the subforms one by one, creating my own subforms and applying the settings you sugggested, binding the individual fields to the full path to data, incrementally assigning the path to the appropriate subform level...
    One thing that happens is the initial drag-n-drop doesn't reveal the contents of the sub form, (they are set as 'visible', and I have tried repeatedly to move the fields to the front etc.). Even when I unwrap from the top down, I only see the fields when I unwrap the last one ( and then I have to bind to the full path to the data).
    A different method within the web service (a validation) displays under 3 subforms without any manipulating.
    If anyone has been able to work through a similar situation please let me know!

  • CS2 - Aligning Objects question

    OK..I want to align one object to another without the second object moving out of position.
    In CS, I swear I clicked on Object 1 (the one I want to align to the second object) and then added Object 2 as a selection......then held down the shift or control key and clicked again on Object 2 to define that object as the one that WON'T move......
    then clicked on a vertical alignment button and Object 1 centered itself to object 2.
    Anyway, I tried this using various methods in CS2 and in each case - - both objects move when centered together....
    What's up with that? Did Adobe change the alignment method yet again?
    How can I keep Object 2 "in position?"
    Thanks.

    Tom,
    Nothing has changed about the alignment method, exactly. However, it has
    never been necessary to hold down the Shift or Control (or Alt) key when reclicking on the selected object that you want to remain in place. In fact, holding down the Shift key will
    deselect any selected object you click on, so holding down the Shift key always disabled the key object feature. Try it in 9 or 10 or CS and you will see.
    What did change in CS2 was that holding down the Ctrl/Cmd key while you already have one of the selection tools active temporarily toggles to the other selection tool. And it has always been the case that the Align palette listens only to clicks from the regular black arrow tool, not to clicks from the Direct Select tool. So what I suspect is happening is that you were starting from the regular black arrow tool, and habitually holding down the Ctrl key when you reclicked on the selected key object, even though the modifier was ignored. Now that the Ctrl key toggles to the other selection tool (in your case the Direct Select tool), you no longer have the correct tool selected when you reclick.
    If you are working from the regular black arrow tool, all you have to do is stop using
    any modifier keys. Which would have worked in earlier versions too.
    Since I habitually work with my main tool being the Direct Select tool, and practically never use the black arrow tool, I actually appreciated the toggle in CS2, since it freed me from having to switch to the black arrow tool in order to set a key object. That is, if you do work with your main selection tool being the Direct Select tool (which generally speaking is a more efficient way to work), you can now set up alignments from that tool, by holding down the Ctrl key to temporarily get the black Select tool, whereas in earlier versions you had to change your tool using a and then change it back using v.
    http://rwillustrator.blogspot.com/2006/03/object-alignment-tips.html

  • Smart Object Question

    I am not a regular to this group and I have to admit I am a little
    behind with my Photoshop learning curve. I just started going thru some info on smart objects and I am really confused about where these smart objects get saved.
    When you go to edit the SO, a dialogue box prompts to save to commit the changes but then the next paragraph of the dialogue says the file must be saved in the same location....is that referencing the saving of the ORIGINAL tif or psd?
    Thanks for any enlightenment on this! CS3
    kristin

    Thanks, Marek!
    So, if the original and "placed" image is moved from its location or deleted...then what happens to the SO status?
    Also, in another scenario, what if the SO does not exist before a layer in a file is converted to a SO...is this SO saved anywhere else or is it just some sort of extension to the file in which it was originally just an ordinary layer?
    kristin

  • ABAP Objects Questions

    Hello Everyone,
    I hope someone could answer the following questions:
    Please look at the below ABAP code
    data: zVar(30)                type c value 'ZTEST_CLASS',
            methodName(30)    type c value 'Test_Method'.
    Question # 1:  Can I define the objVar as below or is there anyother way to accomplish this?
    data:  objVar  TYPE REF TO  zVar.  (Please note that zVar is the variable that contains the name of the 
                                                           class)
    Question # 2: Can I create the object objVar from the above question as below?
    CREATE OBJECT objVar.
    Question # 3: Can I call the method of objVar as below
    CALL METHOD objVar->Test_Method (please note that test method is a variable that contains the name
                                                             of the actual method)
    Thanks in advance.
    Regards

    All these Can be done using Dynamic programming.
    check this
    REPORT  ZTEST_CLASS.
    data: zVar(30) type c value 'ZCL_TEST1',  "<--class name
    methodName(30) type c value 'TEST'.   "<----Method name
    data: obj type ref to object.
    create object obj TYPE (zvar) .
    call method obj->(methodname).
    break-point.

  • CS5 Smart Object Question

    I just migrated from CS4 to CS5 , I have a .psd that has layers with that are photos which contain blending layers inside their original psd's. They were  converted and imported to the main.psd as jpgs. Is there a way to convert each of those layers to a smart object and in my case edit the blended layer which contains a blackborder so I can make the border smaller?
    Or do I need to get the original jpg photo, create a new border and resave as a jpg?
    rd

    I don’t quite follow, but I would assume that one should place the files without the borders and possibly just apply the Layer Style Stroke.
    One can certainly convert a Layer to a Smart Object, but if that Layer has been transformed before that won’t improve image quality and it certainly would not change a flattened layers back to a previous multi-layer-state – but like I said I may be misunderstanding the question.

  • Activex Object Question

    Hi,
    I posted this question by mistake in the LabVIEW/CVI fourms, so I am reposting it here.  I have a question about how LabVIEW "sees" activex controls.  I have a dll, which displays createable objects in the activex menu.  LabVIEW sees the type library name and I can create methods and property nodes.  Now, when I load the same dll into VB 2008, I get the self-registration error, eventhough the dll was manually registered using regsrv32.  What is LabVIEW doing to be able to "see" the activex controls inside the dll?

    Hey shivels,
    The dll you are using is working properly in LabVIEW? It seems like the problem is less with LabVIEW and more with VB2008. It might be more helpful to post your question in a forum for VB2008 to figure out why it is not working. The lowest level code that LabVIEW is using to interface with ActiveX is not information that is really make available.
    Hope this helps.
    -Ben
    WaterlooLabs

  • Session object question put vs. putValue vs. setAttribute?

    I have the following code:
    <%@ page import="java.util.*" %>
    <jsp:useBean id="EducationBean" class="java.util.Hashtable" scope="session" />
    <%
    String swCurrFileName = "swcontrol.jsp";
    Enumeration params = request.getParameterNames();
    while (params.hasMoreElements()) {
         String name = (String)params.nextElement();
         EducationBean.put(name, request.getParameter(name));
    %>
    My question is I can't find any documentation on the put command, whats the difference between 'put', and 'putValue', and 'setAttribute'? When I try using the 'putValue' or 'setAttribute' command I get errors.
    What I'm trying to do is store form values in a session object across several pages, and on the last page display all the form values from the previous pages.

    the object you are calling put on is a java.util.Hashtable. put places an object into the table to be keyed off of another object. In your case, your key is the variable name and the object to be stored is your parameter from that name.
    the putValue and setAttribute are methods on the session object. They both do the same action as above, but are for HttpSession objects. putValue is deprecated and you should be using setAttribute, but most WebServers have putValue() pointing to the setAttribute() method. hope this helps.

Maybe you are looking for