Hello.
I’m trying to do a countdown of days since the last accident onsite. I know that I’d need to subtract the days since today and the most recent recorded date, but I have no idea of how to put it into a formula.
Hello.
I’m trying to do a countdown of days since the last accident onsite. I know that I’d need to subtract the days since today and the most recent recorded date, but I have no idea of how to put it into a formula.
Hello @gerardo.cebollero,
I did a video that covers very much what you are describing.
https://www.dundas.com/learning/extend-your-data-with-dundasscript
enjoy
-jeff
Thank you Jeff. I have a further question. How can I make sure the formula utilizes the most recent date? As in, I don’t necessarily need to just get an aging, but rather, need the formula to do the calculation by subtracting the difference from the most recent incident.
Hi Gerardo,
If you need the most recent date, just create a metricset that sorts your dates descending and perhaps select only the top 1 (both are options in the metric set menu). If you’re trying to take a full table and subtract the difference from the most recent incident across many columns, you might want to bake this information into a datacube or try a formula metric set from two existing metric sets.
If you’re unfamiliar with anything that I described above, please let me know and i’ll point you to some reading material.
cheers.
These should help.
Sorting - to put your most recent date at the top
https://www.dundas.com/Support/learning/documentation/data-metrics/metric-set-analysis-tools#h4-sorting-and-filtering
Once you have the dates you want at the top of your metric set - limit the records return since you probably don’t want all of them. https://www.dundas.com/support/learning/documentation/analyze-data/displaying-top/bottom-records
Also useful: Formula visualization for combining data. Depending on your exact need, you might want this as it’s very handy.
https://www.dundas.com/support/learning/documentation/analyze-data/formulas/adding-formulas#h5-formula-visualizations
The next version introduces Data Tokens, that will enable the user to query data for any primitive values like dates, strings or numeric values. Such a token will let you query your table of choice for the last used date.
Hello Jeff. Would the aging query work if the data was uploaded from an excel log? I’m doing the dashboard from a log for now until we can get the process automated with IT. But I’ve been trying to get the query running and always get these errors:
Data retrieval failed, as it was not possible to generate a valid query for the specified metric set.
Version: 5.0.1.1005
Runtime error Object reference not set to an instance of an object. Line: 2 Column: 56
Hi @gerardo.cebollero - in the case of this error message, please reach out to support@dundas.com. As far as i can see, there should be no reason you can’t do this. Also, you are on a fairly old version of Dundas BI and it might be worth an upgrade if you can as it might solve this for you.