Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

difference between two array

Posted on 2006-05-31
9
Medium Priority
?
310 Views
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
0
Comment
Question by:varvoura
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 46

Assisted Solution

by:Sjef Bosman
Sjef Bosman earned 300 total points
ID: 16796776
Swap array1 and array2:
    @TextToTime(@Trim(@Replace(@Text(array2); @Text(array1); "")))

Please analyse carefully what happens in the code...
0
 

Author Comment

by:varvoura
ID: 16797176
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
0
 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 150 total points
ID: 16797343
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

Steve
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:varvoura
ID: 16797383
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
0
 
LVL 18

Accepted Solution

by:
marilyng earned 300 total points
ID: 16797995

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:

alldates
selecteddate
newdates

newDates:=@replaceSubstring(allDates;selecteddate;"")
0
 
LVL 46

Expert Comment

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

Expert Comment

by:marilyng
ID: 16832051
Ah, I would be interested in that, too.  
0
 

Author Comment

by:varvoura
ID: 16840728
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.

Thanks
0
 
LVL 18

Expert Comment

by:marilyng
ID: 16841487
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:

@Replace
@ReplaceSubstring
arrayreplace
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++ :)




0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses
Course of the Month20 days, 14 hours left to enroll

810 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