Am 06.09.2013 22:26, schrieb Allin Cottrell:
On Fri, 6 Sep 2013, Sven Schreiber wrote:
> This is a placeholder/reminder that I think it happens to me that I use
> 'join' with a filter of the form --filter="varname >= value" but
the
> operation sometimes seems to apply the condition '>' instead of
'>=".
>
> I don't have time right now, but I will try to produce a minimal example
> later.
I've tred playing around a bit but did not manage to provoke such an
error. I've also looked through the underlying C code and didn't
spot a flaw that might account for the error. So if you can come up
with a reproducible example that would be great.
Getting there -- I can perhaps narrow it down some more. At the end of
the message I have a real-world data excerpt with all the realtime data
for two periods, namely 2001m10 (aka 2001-10-01) and 2001m11 (aka
2001-11-01). For certain reasons I'm interested in the vintage of
2010-06-24, which means the following lines in this example (with
realtime_start_date in the 3rd and realtime_end_date in the 4th col, see
below):
2001-10-01 98.4253 20090327 20100624
2001-11-01 97.9427 20090327 20100624
Inside my functions, I'm using the following join command (where
strvin="2010-06-24":
<hansl>
# and also get the corresponding start dates to verify
join @fpath startdates --tkey=observation_date --time="%Y-%m-%d" \
--data=realtime_start_date --filter="realtime_end_date >= @strvin" \
--aggr="seq:1"
</hansl>
Verbally, this should look for the vintage of 2010-06-24 (with a
workaround: vintages whose validity did not end before the date
2010-06-24, and take the first of these), and then give me _not_ the
value of the variable, but the date when this vintage was published.
Now, gretl gives me the following output in the 'startdates' series:
2001:10 20090327
2001:11 20100625
Notice that the first value gets the correct publication date (see
above), but the second value is wrong; it is the publication date of the
_following_ vintage, which after applying the filter in join should be
the 2nd matching line, not the 1st one as requested per "seq:1". Or like
I said before, it is as if gretl is partially filtering by ">" instead
of ">=" suddenly.
Or am I missing a bug in my own commands here?
thanks,
sven
-------------------------------------
<realtimedata>
observation_date INDPRO realtime_start_date realtime_end_date
...
2001-10-01 139.3070 20011116 20011126
2001-10-01 136.8910 20011127 20011213
2001-10-01 137.5510 20011214 20020115
2001-10-01 137.4540 20020116 20020214
2001-10-01 137.6700 20020215 20021204
2001-10-01 109.5120 20021205 20031109
2001-10-01 109.9120 20031110 20041221
2001-10-01 109.7380 20041222 20051106
2001-10-01 98.3450 20051107 20060413
2001-10-01 98.3453 20060414 20061210
2001-10-01 98.2665 20061211 20080327
2001-10-01 98.4163 20080328 20090326
2001-10-01 98.4253 20090327 20100624
2001-10-01 87.4715 20100625 20110324
2001-10-01 87.4550 20110325 20120329
2001-10-01 87.7031 20120330 20130321
2001-10-01 87.6738 20130322 99999999
2001-11-01 137.1390 20011214 20020115
2001-11-01 136.9030 20020116 20020214
2001-11-01 137.0970 20020215 20020314
2001-11-01 137.2400 20020315 20021204
2001-11-01 108.8450 20021205 20031109
2001-11-01 109.3540 20031110 20041221
2001-11-01 109.1850 20041222 20051106
2001-11-01 97.9060 20051107 20060413
2001-11-01 97.9061 20060414 20061210
2001-11-01 97.7567 20061211 20080327
2001-11-01 97.8874 20080328 20090326
2001-11-01 97.9427 20090327 20100624
2001-11-01 87.0363 20100625 20110324
2001-11-01 87.0138 20110325 20120329
2001-11-01 87.2363 20120330 20130321
2001-11-01 87.2008 20130322 99999999
</realtimedata>