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

[Question -Help] Using dynamic text variables in filtering report data and auto-deletion #417

Open
molbar opened this issue Nov 20, 2024 · 0 comments

Comments

@molbar
Copy link

molbar commented Nov 20, 2024

Hello,

Could somebody explain what is missing for me to be able to use dynamic variables on a Date field?

Problem statement:

I cannot get the filter working on a Date field. Static filtering works, dynamic not.

MyProcess:

  1. My Data is uploaded using API 3.0 from python:

dataset.append({"dimension1":key,"dimension2":"%now%","value":value})
payload={"data":dataset}
request = urequests.post( url, json = payload, headers = HTTP_HEADERS, auth=(user,passw))

  1. Uploading process on server side converting %now% -> Epoch time f.e: 1732088069

  2. From the dataset report is created using Key, Date and Value

image

Challanges:

If I use dynamic text variable in the Date filter I cannot get it working

image

This filter setting returns zero records however I have data from yesterday and from today.

Tests

As I understand %yesterday% should be parsed to 1731974400
If I test the code and run in a sandbox the function
private function parseFilter($filter)
print_r(parseFilter('%yesterday%'));
from the file VariableService.php
it returns:
Array ( [value] => 1731974400 [option] => GT [1$filter] => yesterday [2$timestring] => -1 day [3$target] => 1732003062 [4$target_clean] => 2024-11-19 [5$startString] => today [6$startDate] => 2024-11-19 [7$startTS] => 1731974400 )

As I understand the filter is using the data in [value] => 1731974400
$parsed = $this->parseFilter($value['value'])

So please help me understand why the filter is not working and showing records where Date is > 1731974400

image

If I replace %yesterday% -> 1731974400 (using the static Epoch time in the filter field) the filter works and returns all records relevant records
image

// Integers echo 1732091501 <=> 1731974400; // 1
// Strings echo "1732034459" <=> "1731974400"; // 1

Many thanks for explanation in advance...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant