My question is in two parts:
1. How to do date based calculations in mql without manually typing the date?
I tried using MQL with something like "SELECT number, name WHERE 'actual finish' > (TODAY-7)", but this does not work. I then had to write my own custom macro to do the date calculations, and then generate an html table. This is not ideal as there is already a table macro...hence my second question.
2. How to call table, pie-chart or other built in macros from my own custom macros?
Comments
2 comments
I don't have an answer for #2, but there is a way to implement #1. (BTW... in the future it's best to split these into two posts.)
You can't put that formula (TODAY - 7) into a MQL query. But you can put a formula property onto a card. Suppose you have Task cards that have a "Due Date" property. Let's you want to generate a report showing all tasks due within the next seven day. Here's how
Create a new Formula property on the Task card called "Due Soon". Set the formula to "Due Date - 7". Make this a hidden property.
Create a table on a wiki page with this query:
SELECT Name, Number WHERE TYPE = TASK AND "Due Soon" <= TODAY AND "Due Date" >= TODAY
This will show you all of the Tasks that are due soon, but not the ones that are overdue.
Right now, you can't delegate from a custom macro to a built-in macro. I've added this request to the Mingle backlog. I could have used this feature recently as well. However, you can create an instance of another custom macro and use it to generate your table. For example, you might be able to use the enhanced table macro to create your table. (I haven't used that macro and there is a comment that it didn't work for somebody.)
Please sign in to leave a comment.