Jay de Halas wrote:

> More to the point, I am having an issue using "Filter: Expression" with
> Date type Data. The Filter: Expression tool works great with numerical
> data, but it appears to be unable to perform Boolean operations with Date
> type data.
> With Date type data the Boolean expression appears to evaluate, but
> generates zero length data sets for the result data.

THis is a shortcoming with the current filtering plugin, as it uses Python 
to evaluate the expression and it assumes numerical datasets.

However, there is a hacky workaround (which might not be supported in future 
versions).

If you go to the Edit->Custom Definitions menu item. Click Add to get a new 
item, change the Type to "import", Name to "veusz.utils" and Definition to 
"dateStringToDate". You'll get some warnings as you do this - click Allow or 
Allow Always here - I need to get rid of these when you are using this 
dialog.

Now you should be able to do filter expressions like

mydataset > dateStringToDate('2011-01-01') & mydataset < 
dateStringToDate('2012-01-01T01:02:03')

Unfortunately the type of the output dataset will be wrong, but you can 
still plot it as a date.

I should fix Veusz to have a function like this as standard (maybe 
Date('2011-01-01')) and keep the datatype the same after filtering.

Jeremy



_______________________________________________
Veusz-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/veusz-discuss

Répondre à