These are chat archives for getredash/redash

12th
Aug 2015
eschultze
@eschultze
Aug 12 2015 17:56
Hi all! Does anyone use ::filter options with dates with mysql? I want to use date >= X and date <= Y but the filter appear as 1 and 0.
Arik Fraimovich
@arikfr
Aug 12 2015 18:35
@eschultze can you give an example for a query?
eschultze
@eschultze
Aug 12 2015 19:06
SELECT data >= '2014-01-01' AS "BEGIN::filter", data <= '2015-08-12' AS "END::filter", DATE_FORMAT(data,'%b|%y') AS DATE, SUM(col1) AS "TOTAL", AVG(col2) AS "MEAN" FROM log_p WHERE id != 7795 GROUP BY Year(data), Month(data)
blob
I think the correct way would be using dates on the WHERE part, but I tried it and the filters don't appear
Arik Fraimovich
@arikfr
Aug 12 2015 19:35
@eschultze that's not how filters work. filters just let you filter by a value in that column, see http://demo.redash.io/queries/143 as an example. or something more similar to what you're trying to achieve: http://demo.redash.io/queries/476/source
if you want to use filters to let user define the begin and end values, then what you're looking for is parameters: http://demo.redash.io/queries/146?p_action=create but this is still work in progress, so it has no UI (you can only set vlaues from the URL)
eschultze
@eschultze
Aug 12 2015 19:38
ok @arikfr my intention was to use a dashboard filter where I could set the date interval and update all the dashboard values with that date range
Arik Fraimovich
@arikfr
Aug 12 2015 19:39
so yes, parameters will better suite you
it also works in a dashboard. but there it's the same problem - no UI. I hope that in ~2 weeks we will have some basic UI for this feature
eschultze
@eschultze
Aug 12 2015 19:43
ok, got it! thanks for the tips ;)
Arik Fraimovich
@arikfr
Aug 12 2015 19:46
happy to help :)