Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Q_21884363.html - furhter clarification

Hi all,

End of question in link above, there is a selection view formula.

It works fine in the sense that it grabs the first value in DueDate(listoftestfield) on my form.

For example,

listoftestdate(my form field) has multi dates and time in it
When I compare this using the last selection formula listed in the above link, then create a column for with @explode(listoftestdate) and flag the column to show multiple values as separate entries, then I get only the first entry in the (listoftestdate) displayed in view.
In that array(field) there is other dates which will match the selection criteria(between 1 and 30 days) but I am not able with this date comparison to display them as entries in the view.

I hope that I didn't confuse everyone with this, but I think that I need some sort modification to how I am comparing the @today to duedate(listofdate) field on my form.

I do know that @today is date value, but i also know that listofdate field is date range (date time) value

Ur help is much appreciated.

0
varvoura
Asked:
varvoura
  • 4
  • 3
  • 3
  • +2
4 Solutions
 
mbonaciCommented:
Hi varvoura,
Try using @Keywords formula to figure out which dates in list1 are in list2...


I don't have much time today, so this is my last post for today.
Marko
0
 
CRAKCommented:
Only as a response to Marko's suggestion (haven't read the preceding question):

@Keywords has one big disadvantage: there are a no. of characters that can not be used in either of the lists, or it will fail. ":" Is one of those characters, which could be in the lists as part of a time component!

An alternative is easy:

InList1NotInList2 := @Trim(@Replace(List1; List2; ""));
InBothLists := @Trim(@Replace(List1; InList1NotInList2; ""));

You may need apply some conversions as @Text and @TextToTime as well...
0
 
varvouraAuthor Commented:
OK, there's a bit of misunderstanding here.

I don't need to replace any values, I just want to view selection formula as follows:

Select form = Product & date1 > @today and date1 < @adjust(@today;0;0;30;0;0)
Where date1 is a multivalue date field.
I am not sure why the view is not selecting all the values in the product document which match the criteria but it is selecting the first value in the date1 field which happens to match the criteria.
If however, value2 in date1 field is still falls in between the above parameters, then it isn't displaying in the view and I want to.

Is this a bit clearer now?
Is there some sort of date array comparison in formula which can achieve this?


0
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.

 
Steve KnightIT ConsultancyCommented:
the way you have it there it will include the doc if any one value is >today and any other or same value is < today+30 which probably isn't  what you are after as the twovalues today+60 and today--30 would trigger it for instance..

Does this multi-value field have a known number of elements which could be split off using @subsEt or @word and te
ted seperately?
0
 
marilyngCommented:
also, have little time. but, going with CRAK and Steve,  you know you can create a formula before the selection:

StartDate:= thisdatevalue or formula;
EndDate:= thisdatevalue or formula;

Select  thisStuff where MyDateField >= [startDate] and myDateField <=[EndDate]

Have you tried something like this?
0
 
Steve KnightIT ConsultancyCommented:
marilyng,

problem isthat won't bring correct results with multivalue date field afai can see.
start:=....;
end:=...;
date1:=@subset(date;1);
date2:=@subset(@subset(date;2);-1);
etc.
select (date1 > start & date1 < end) & (date2 > start & date2 <end) etc.

is only way I can think of at the moment which is a fixed No. of elements hard coded ... maybe could use r6 formula looping constructs here, haven't used them in selection formulas.

Once you are in you'd have to process the column for date to show just the correct elements too... v.messy
0
 
marilyngCommented:
@Contains(thislottadates, thisstartdate) & @Contains(thislottadates, thisenddate) ??
0
 
Steve KnightIT ConsultancyCommented:
ok how about this

start:= ....;
end:= ...;
alldateslist:=@explode(start:end;...);
(or is it implode? to explode into each date in range anyway)

then can use @contains for selection formula against this list.

in multi value field showing date can use replace command to just include dates also in above list.

again, sorry but no notes client or real keyboard to fill in all the syntax specifics

Steve
0
 
CRAKCommented:
I've set up a test-form to figure out an approach, but it offers unexpected results.
All may depend on what value(s) "date" actually has: a single value, a set of values or a range.

I've created two editable date/time fields: RangeStart and RangeEnd.
Then I added 3 computed date fields, all multi value:
Multi = RangeStart : RangeEnd
Range = @TextToTime("[" + @Text(RangeStart) + "-" + @Text(RangeEnd) + "]")
ExplodedRange = @Explode(Range)

3 computed texts should give me an indication on wether or not a document would be selected:

@If(Multi > @Today; "Future"; "-")
@If(Range > @Today; "Future"; "-")
@If(ExplodedRange > @Today; "Future"; "-")

If I set RangeStart to 12 Jun 2006 and rangeEnd to 17 Jun 2006, with @Today = 14 Jun 2006, here's what I get (after pressing F9):

Multi = 12-06-2006; 17-06-2006 (result: "Future")
Range = 12-06-2006 - 17-06-2006 (result: "-")
ExplodedRange = 12-06-2006; 13-06-2006; 14-06-2006; 15-06-2006; 16-06-2006; 17-06-2006 (surprisingly no restul shows up)

Odd, but clearly the range is playing us parts!
I bet @Min(date) or @Max(date) may help in the evaluation.....
0
 
CRAKCommented:
Of course I did another test:

Field DtSet (DateTime, Editable), default = [12-6] : [13-6] : [15-6] : [16-6]
Computed texts show
@Min(DtSet) = 12-06-2006
@Max(DtSet) = 16-06-2006
@If(@Min(DtSet) > @Today; "Future"; "-") = "-"
@If(@Max(DtSet) > @Today; "Future"; "-") = "Future"
0
 
marilyngCommented:
Hey, CRAK can you check: http://www.experts-exchange.com/Applications/Email/Lotus_Notes_Domino/Q_21884173.html  needs your special expertise, thanks.
0
 
Steve KnightIT ConsultancyCommented:
OK, this seems to work for me :-)

today:=@Today;
end:=@Adjust(today;0;0;30;0;0;0);
TestDatesList:=@Text(@Explode(@TextToTime("["+@text(today)+" - "+@Text(end)+"]")));
REM "This should select any dates in TestDates that are also in the exploded date range today to today+30";
select (@Text(TestDates;"S0")=TestDatesList);

Then for your multi-value date column to just include the correct dates:

today:=@Today;
end:=@Adjust(today;0;0;30;0;0;0);
TestDatesList:=@Text(@Explode(@TextToTime("["+@text(today)+" - "+@Text(end)+"]")));
@TextToTime(@Keywords(TestDatesList;@Text(TestDates;"S0")));
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now