Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Hello,
I am using thing Worx 9.3.0 version , I want to display the 7 days data on the bar chart , whether it may be recent 7 days or any when I select the start date to end date only that data should get displayed in the mashup ,
As of now my mashup bar chart is having data from last 2 years so I need to make the chart which can be selected and viewed according to dates instead of all data
please help me what needs to be done , if anyone have some ideas on this
Regards,
Shree
Solved! Go to Solution.
Hi @NH_shree
You can create a service with dateTime inputs to accept input from DateTime Widget and query data from DB
And whenever DateTime value is changed in Mashup, you can trigger this service to fetch new Data from DB
/VR
Hello @Velkumar ,
I am getting my data from the external database connected to thingworx , to access it I am using sql queries services in thingworx.
Regards,
Shree
Hello,
Here is the bar chart image that i am getting , we cannot make out anything from this and it is looking like a thin line instead of bar , please help if anyone has a solution with you.
Regards,
Shree
HI @NH_shree
While querying data from DB, you can specify the dateTime range and get only the required data
select * from TABLE_NAME where timeStampeValue > STARTDATE and timeStampeValue < ENDDATE
In Thingworx SQL Query should look like this,
/ VR
Hi @Velkumar ,
Can't we use datetime widget and make the graph works based on the dates which we select ,
suppose for example if we are getting all data in the chart can we just select from 01/05/2023 to 7/05/2023 data to be displayed on the chart and meanwhile if we want to change the dates it should reflect in the viewmashup screen like we should give the input on the view mashup screen instead of mentioning start and end date in the sql query service ,
I am expecting the output like this, is it possible to do and how can we do ?
Regards,
Shree
Hi @NH_shree
You can create a service with dateTime inputs to accept input from DateTime Widget and query data from DB
And whenever DateTime value is changed in Mashup, you can trigger this service to fetch new Data from DB
/VR
Hello @Velkumar ,
I have written a service as you have given in the above image and if I try to execute the service it is not giving me the exact values or data within the mentioned date , here I have the screenshot of the service executed
please guide me where i went wrong?
Regards,
Shree
Hi @Velkumar ,
Thanks for the solution, I have solved it , I made a mistake in chart1 service that I did not added the input parameters hence I was getting all the rows in chart2 service , when i added the startdate and enddate input parameters the service got me the actual result
Thanks & Regards,
Shree