Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering a time chart by text variables is not working #382

Closed
molbar opened this issue Jan 1, 2024 · 4 comments
Closed

Filtering a time chart by text variables is not working #382

molbar opened this issue Jan 1, 2024 · 4 comments
Assignees
Labels
needs info feedback from requester required
Milestone

Comments

@molbar
Copy link

molbar commented Jan 1, 2024

Hello,

I could not make filtering of Date happen on a time chart. Even though i found similar issue reported by @PVince81

I tried to follow:
Instructions: https://github.com/Rello/analytics/wiki/Filter,-chart-options-&-drilldown##text-variables
Reported issue/solution: #321 Filter variables to use same time format like chart

Case description:

Data is POST-ed from a microcontroller using REST API
POST frequency: 1 min

Dataset:

Object: "str" Data ID
Date: Text Variable %now% -> transformed to unix timestamp epoch to DB
Value: "int"

Applying multiple text filter for Object column works fine
image

Applying .js format parser on X axes works fine:
{"scales":{"xAxes":{"time":{"parser":"X"}},"secondary":{"display":true}}}

However:
Adding an additional filter using the text variables could not bring me to the expected behavior:
Expected behavior: Only recent data is shown (today or not older than 24 hours)
Tried to use the following variations:

  • "Date" "greater than" %yesterday% (U) -> Same data, no filtering
  • "Date" "greater than" %yesterday% -> Same data, no filtering
  • "Date" "equal to" %today% (U) -> No data found
  • "Date" "greater than" last 1 day -> Same data, no filtering
  • "Date" "greater than" last 1 day(U) -> Same data, no filtering
  • "Date" "less than" last 1 day (U) -> No data found
  • "Date" "greater than" 1704103112 -> working fine so no filter issue rather like a format text variable issue to epoch
@molbar
Copy link
Author

molbar commented Jan 9, 2024

I was checking the function: private function parseFilter($filter) today

It seems to be working fine.

$filter = "%last 1 day% (U)";

returning:

Array
(
[value] => 1704672000
[option] => GT
[1$filter] => last 1 day
[2$timestring] => -1 day
[3$target] => 1704699662
[4$target_clean] => 2024-01-08
[5$startString] => today
[6$startDate] => 2024-01-08
[7$startTS] => 1704672000
)

So I still cannot figure out why

This works with returned value:
image

This is not working:

image

@Rello Rello self-assigned this Jan 9, 2024
@Rello
Copy link
Owner

Rello commented Feb 26, 2024

Hi, what is the number format of your timestmap? just the number or including a U?
Bildschirmfoto 2024-02-26 um 12 03 52

@Rello Rello added in progress development in progress needs info feedback from requester required labels Feb 26, 2024
@Rello Rello added this to the 4.13.0 milestone Feb 26, 2024
@molbar
Copy link
Author

molbar commented Feb 26, 2024

Hi,

If the question is for the timestamp in the database, I use the:
Text Variable %now% ->Upload REST API from python -> transformed to unix timestamp epoch by Analytics/NC
I would guess the format stored in DB is just the number.
Hope I understood your question correctly

@Rello
Copy link
Owner

Rello commented Feb 27, 2024

Hi,
I have problems reproducing it with my current available data.
can you export the Report via the export button and send it to analytics@scherello.de ?
thank you

@Rello Rello closed this as completed May 24, 2024
@Rello Rello removed the in progress development in progress label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs info feedback from requester required
Projects
None yet
Development

No branches or pull requests

2 participants