So I have a database in SQL that only shows data for the moth that we are currently in. I am looking for a way to either have the name of the database update automatically every month or just use ignition itself to store and pull the data from.
The problem is that next month i will have to go into SQL and change the name of the database to ‘sqlt_data_1_2022_08’ or else the table will not record any data because it is still looking for the data form the previous month.
Or if you have a 3rd party system that is reading data, then you would store that data specifically for that system using the Transaction Manager and generating your own specific tables for that system.
The point is you shouldn’t need to pull from the historian tables manually like this at all. If you need to just query the historical data then you should use system.tag.queryTagHistory() it will take care pulling data from the correct table and joining across partitions if needed.
So the reason I am pulling the data manually is because I have multiple markers on a map. When I click on the marker it brings up a popup of the table that shows the data for the marker I have clicked on.
So in the query we are looking for the selected_tag_path because I made a custom property with that name to be used in the query.
So the query is being used to find the specific data for a specific marker so when the marker is clicked on it will bring up the data on the popup for that marker.
I’m not sure I completely understand what you’re doing, what I think is that you’re selecting a marker on the map which sets a custom property to the tagPath for that marker, and then you’re wanting to use that tag path to display historical data.
Sorry it’s been a hot minute since I’ve done this in Perspective.
So you will need to do one of two things.
Change your selected_tag_path property to be an array and have a single array member under it as an object that has an aggregate, alias and path member. Then when you click on the map update the path member.
Have a custom property that is bound to the current selected_tag_path property and then use a script transform to generate the array of dictionaries to generate the list of tags to send to the history binding.