difference between two array

Posted on 2006-05-31
Last Modified: 2013-12-18
Hi there,

Anyone has an idea what formula I need to use to get the difference between two time arrays.

array110/11/2006, 10/12/2006
array2 10/12/2005, 10/11/2006, 10/12/2006
arra3 should show only 10/12/2005

When I use @TextToTime(@Trim(@Replace(@Text(array1); @Text(array2); ""))) OR
@TextToTime(@Trim(@Replace(@Text(array2); @Text(array1); "")))

I don't get the results.

thank you in advance
Question by:varvoura
    LVL 46

    Assisted Solution

    by:Sjef Bosman
    Swap array1 and array2:
        @TextToTime(@Trim(@Replace(@Text(array2); @Text(array1); "")))

    Please analyse carefully what happens in the code...

    Author Comment

    That exactly what I had and it. When I delete an entry from array1, array3 populate the entire array2.

    array1 28/09/2006, 27/11/2006, 26/01/2007, 27/03/2007, 26/05/2007
    array2 30/07/2006, 28/09/2006, 27/11/2006, 26/01/2007, 27/03/2007, 26/05/2007

    I deleted 30/07/2006

    Now array 3 has
    30/07/2006, 28/09/2006, 27/11/2006, 26/01/2007, 27/03/2007, 26/05/2007

    Which I believe is what it is suppose to be doing.

    I had this working yestersday for a little while where array3 displayed only 30/07/2006 using some @replace but for whatever it is worth and no matter how hard I tried today, it wouldn't work today.

    Could it be because array2 is a duplication of array1 but a computed field with the following value:

    @if(array2 = "";array1;array2)
    What I am doing here is keeping a complete list of array1 in array2 which I can use for comparison when dates get deleted from array1. For example, array1 and array2 have exactly the same dates, when i delete date1 from array1, I want array3 to record that deletion, this way, I know which testdates have been removed from my list of dates
    LVL 43

    Assisted Solution

    by:Steve Knight
    Haven't worked through your formula but why not set the value of array2 to just array2 and use a postopen event to set it to the value of array1 then it won't change along with array1


    Author Comment

    I swear to you, that's exactly what I was doing right now because it was starting to get on my nerves. this however still doesn't solve my first problem
    LVL 18

    Accepted Solution


    remove the template from the designer
    close designer
    compact your workspace.

    When stuff works one day and if you haven't made any changes and it does work the next, usually designer workspace cache is messed up.

    Typical sign is views that don't change or show collections where there are some.

    May not help.

    When you have these three arrays, you need button to delete the single date, if array2 is formula to itself, then you need to replace the formula.

    So, the button goes... which date?  Show list of dates.

    now you have a replace formula:


    LVL 46

    Expert Comment

    by:Sjef Bosman
    Judging from the B, you didn't get the right answer. So what was the real solution to your problem?
    LVL 18

    Expert Comment

    Ah, I would be interested in that, too.  

    Author Comment

    Hi there,

    You would notice on the forum that I've asked the question 4 different ways to get the right answer, nope, this is not the right answer for my question.
    Q_21874570.html modified correctly will definitely give me the answer.
    I attempted this yesterday without the function call by modifiying the script to work on date1, date2 variant fields and the return array being date3 which is the third date field on the document and the one document which will end up with those dates that are exclusive to date2(another word, any duplicates dates between date1 and date2 will be earsed and those remainder non duplicate entries will remain and set to date3).
    Anyway, unsuccessful attempt, I end up with the same result that @replace(@text(date1;@text(date2) , another word, i had displayed in date3 all the dates in date2.

    Talking about persistence...
    I'll let you guys know how I go with it as I am soon to give it another attempt, but if you can anything to this, it would be great.

    LVL 18

    Expert Comment

    The different between two arrays is the same answer no matter how many times you ask it.   It's either a method, or a formulas, and usually includes these:

    forall a in arrays...

    These are all the correct methods to how to get the difference between two arrays.  

    We have nothing to add, unless you want the methods in javascript, java and C++ :)


    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    Lotus Notes restore mail problem 5 585
    Email relaying to outside address 4 148
    Lotus Notes 6.5.5 6 193
    Migration Lotus to Exchange 2016 4 114
    Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
    This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now