[Glass] Duplicated result on Queries
BrunoBB via Glass
glass at lists.gemtalksystems.com
Thu Jul 5 12:53:36 PDT 2018
Hi,
This is a revisited issue:
http://forum.world.st/GsQuery-results-are-duplicated-td4929023.html
GS version: 3.4.1
|set|
set := RcIdentityBag new.
set add: (Date fromString: '01/01/2018');
add: (Date fromString: '02/01/2018');
add: (Date fromString: '03/01/2018').
(GsQuery fromString: '(each.year|dayOfYear = 2018) | (each.dayOfYear|year =
2018)'
on: set) size.
This answer 6 but the set size is 3.
It seems when both predicate terms answer true --> duplicated result.
If you change to 2019 in the second predicate term --> answer is correct
(3).
|set|
set := RcIdentityBag new.
set add: (Date fromString: '01/01/2018');
add: (Date fromString: '02/01/2018');
add: (Date fromString: '03/01/2018').
(GsQuery fromString: '(each.year|dayOfYear = 2018) | (each.dayOfYear|year =
2019)'
on: set) size. "answer 3"
The following answer 9:(
|set|
set := RcIdentityBag new.
set add: (Date fromString: '01/01/2018');
add: (Date fromString: '02/01/2018');
add: (Date fromString: '03/01/2018').
(GsQuery fromString: '(each.year|dayOfYear = 2018) | (each.dayOfYear|year =
2018)
| (each.year = 2018)'
on: set) size.
regards,
bruno
--
Sent from: http://forum.world.st/GLASS-f1460844.html
More information about the Glass
mailing list