Compare GUID and Time to filter

  • I've been trying to solve this issue for a couple of hours now, either from the mongodb side or the csv side, it seems like it will be easier to do it from the csv side of things.


    What I am trying to do is filter a column called guid by another column called time. The guid field has multiple duplicates and the time is unique per guid.


    Sample data:
    GUID, Time
    6, 1
    6, 2
    6, 3
    7, 4
    7, 5
    7, 6


    The output needs to be:
    6, 3
    7, 6


    Eliminating the duplicate guids by the most recent time.


    I know I can kind of do this by sorting the guids then adding a level and sorting time by greatest then eliminating duplicates but when comparing the data I found that it actually eliminated the wrong duplicates and I had data that was older than the most recent.


    I don't mean to seem like I'm putting this work on someone else, I am also trying to figure out how to do this on my own.

  • Re: Compare GUID and Time to filter


    Quote from holycow;718699

    Provided the data is in the same order as your example, then attached will work


    His works perfect, and only requires me to adjust the output of my export to have GUID and Time next to each other, I did have to adjust it to accomidate the 107411 cells but that was relatively easy, thank you!

  • Re: Compare GUID and Time to filter


    Quote

    ...and only requires me to adjust the output of my export to have GUID and Time next to each other...


    If you attach a sample of the export file we can make sure GUID and Time are next to each other.

  • Re: Compare GUID and Time to filter


    Quote from holycow;718730

    If you attach a sample of the export file we can make sure GUID and Time are next to each other.


    Here is a sample layout:
    forum.ozgrid.com/index.php?attachment/61275/


    As you can see GUID is in A and Time is in H and the fields between are usually populated with a lot of data. Its no problem for me to re run my query with a slight modification to --fields to have guid and time next to each other however I also have to space the data out after C, which isn't an issue at all :) as this does what I need it to do.


    Edit: I'm comparing my old way of doing this and the script and the old way is giving me 5470 results while the script is giving me 3396 curious if something is going on.

  • Re: Compare GUID and Time to filter


    Quote

    Edit: I'm comparing my old way of doing this and the script and the old way is giving me 5470 results while the script is giving me 3396 curious if something is going on.


    Would need to see your actual data. Can you either attach workbook here (if less than 200 kb) or upload to a file hosting site and post link here (if bigger than 200 kb).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!