In previous blog, we have learned about how to use Date filter in Open Source BI Helical Insight application version 5 with different options like In Between, in Range, Equals, Greater Than, Less Than, Greater Than Equal to, Less Than Equal to etc.
Helical Insight allows to pass filter name and filter values also directly in the URL of the report/dashboard. In this document, we will learn about how we can pass Relative values like today, tomorrow, yesterday, today-n, today+n etc as well in the URL. Note that this is working after version 5.2 onwards (5.2.0.1473 GA).
Firstly, let us create a report in Helical Insight application version 5 using one of the date field in the selection as well as one of the date field in the filter section.
For reference, you can see the screenshot above which contains a normal report created from Date field. This report is in Create/Edit mode. We have applied In Range filter condition on this report.
We will open the same report from “File Browser” into new tab using option “Open in new window” option.
When you open this report into new window, URL of the report will be something like:
http://127.0.0.1:8085/hi-ee/#/report-viewer?dir=yuva&file=RelativeDate.hr&mode=open
In this URL, we can append our relative date filter parameter values. For example, filter label in our sample report is “Date_of_Round” and condition used for the filtering is “In Range”. So we can pass the values of range in direct URL as below:
http://127.0.0.1:8085/hi-ee/#/report-viewer?dir=yuva&file=RelativeDate.hr&mode=open&Date_of_Round=today-700&Date_of_Round=today
First parameter is pointing to starting date (Date_of_Round=today-700) and second parameter pointing to ending date (Date_of_Round=today).
Output after passing the parameters is as below:
This will show us the data from today-700 days to today. This is just one of the examples. There can be N number of permutations and combinations possible using this kind of relative dates by Adding and subtracting it from year, date, month, quarter, hour, minute, second etc.
In the above example we used Today, possible options are mentioned below:
today
tomorrow
yesterday
today+n
today-n
year
year+n
year-n
quarter
quarter+n
quarter-n
month
month+n
month-n
hour
hour+n
hour-n
minute
minute+n
minute-n
second
second+n
second-n
to_date
Some more examples to use above functions for range related filter conditions:
# Range related filter conditions:
Syntax | Example |
---|---|
fiscal_year=year-4&fiscal_year=year-1 | (Last 4 year) |
fiscal_year=year+1&fiscal_year=year+6 | (Next 6 year) |
fiscal_year=year&fiscal_year=to_date | (To date) |
NOTE: Here fiscal_year is name of filter
NOTE: While passing filter labels, conditions etc are case sensitive.
Please reach out to support@Helicalinsight.com in case of any more questions.