Page 2 of 3
Re: How to create a statistic dashboard ?
Posted: Mon Jun 05, 2023 11:44 pm
by yvesf
If I use a display object, I can retrieve a value per day per month, per year ( 1 display object per request). Is it the right way to do that ? The request behind each display object will be refreshed at which moment ? Many thx for your help.
Display.PNG
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 7:41 am
by kev1n
yvesf wrote: ↑Mon Jun 05, 2023 11:44 pm
If I use a display object, I can retrieve a value per day per month, per year ( 1 display object per request). Is it the right way to do that ? The request behind each display object will be refreshed at which moment ? Many thx for your help.
Display.PNG
It depends on what and how many values you want to display. If you only need to display one or a few values in a single row, the display object is an appropriate choice. On the other hand, if you require multiple columns and rows for displaying data, a browse form (embedded iframe) would be more suitable.
The display object is refreshed when the form is initially opened or when it is refreshed with nuRefreshSelectObject() function.
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 7:42 am
by kev1n
yvesf wrote: ↑Mon Jun 05, 2023 8:48 pm
Do you mean with run(iframe) based on report and not based on form ?
A Run iframe object is nothing else then an embedded Browse form.
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 8:42 am
by yvesf
A run iframe object is a method to embed the related browse form anywhere. I have only one browse form per form not as many as I want.
You mention I can have as many requests as I want based on one form ? Could you explain me how you do that ?. Many thanks again and sorry for this long thread. I don't see how to build a statistic dashboard with nubuilder as it is certainly easy to do so.
Yves
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 8:52 am
by kev1n
It is not entirely clear to me from which data you want to display the dashboard. Could you please clarify whether you intend to display statistics for a single record or for all data within a table? This will help me provide you with more accurate information and assistance.
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 9:52 am
by yvesf
Hello Kev1n,
Thx for your reply. Let me try to expose what I would like to have.
I have a simple table invoice with the related fields :
1.- Invoice form
id, customer, price, date, status
represented like this in the browse form.
2.-Request of the form
Code: Select all
select fact.fact_id, fact.customer, fact.price, fact.date, fact.status from fact
I would like to have the turnover by day, week, month and year in a dedicated launch form.
Request 1 : turnover per day
Code: Select all
select sum(price) from fact group by DATE_FORMAT(fact_date, '%Y-%m-%d') ASC
Request 2 : turnover per month
Code: Select all
select sum(price) from fact group by DATE_FORMAT(fact_date, '%Y-%m') ASC
Request 3 : turnover per year
Code: Select all
select sum(price) from fact group by DATE_FORMAT(fact_date, '%Y) ASC
I would like to represent that in a dedicated launch form statistics in which I will have as nicest as possible :
-------------------------------------------------------------------------
turnover per day :
2023-06-01 - € 1520
2023-06-02 - € 1640
2023-06-03 - € 0
2023-06-02 - € 4820
turnover per month :
2023-04 - € 0
2023-05 - € 0
2023-06 - € 7980 ( 1 520 +1 640+0+4 820)
turnover per year :
2023 - € 7980
-------------------------------------------------------------------------------------
Of course, numbers should be extracted from the same form fact.
What is the best method to do that ?
Thx
Yves
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 9:54 am
by kev1n
yvesf wrote: ↑Tue Jun 06, 2023 9:52 am
What is the best method to do that ?
This is what I suggested:
kev1n wrote: ↑Mon Jun 05, 2023 6:15 pm
Use a launch form and place on it as many run (iframe) objects as you want?
or use charts.
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 10:23 am
by yvesf
Thx Kev1n.
But run(iframe) object on form works only with 1 request, the one behind browse form. As I have only 1 form, how can I use this run(iframe) with 4 different requests ?
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 11:00 am
by yvesf
I have attached a basic database in which I have a launch form statistics in which I have tried to use your recommended approach. (run (iframe) object.)
Could you please take a look and make recommandations based on this example ?
06-06-2023_075736_647ef500095cf_nuBuilder_backup.sql.gzip
Many thx
Yves
Re: How to create a statistic dashboard ?
Posted: Tue Jun 06, 2023 11:07 am
by kev1n
Is it supposed to look like this?
2023-06-06_110706.png