Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom fields - Analytics #65

Closed
korlikiangel opened this issue Feb 2, 2021 · 15 comments
Closed

Custom fields - Analytics #65

korlikiangel opened this issue Feb 2, 2021 · 15 comments
Labels
enhancement New feature or request

Comments

@korlikiangel
Copy link
Contributor

Hi,

Please tell me if it is possible to add a report to the Analytics tab that will sum the values in the custom fields if they are numbers. From a selected time period of created tasks. An example of what this would look like in the image below, thanks in advance for the information.

image

@creecros
Copy link
Owner

creecros commented Feb 2, 2021

is your question in reference to, MetaMagik, in its current form?

or, are you just simply asking me if this is possible?

Currently, no, I have not implemented such a thing. But, yes, it is possible.

@creecros creecros added the enhancement New feature or request label Feb 2, 2021
@korlikiangel
Copy link
Contributor Author

I have to admit that such a feature would make work much easier, so if such a report is possible, would you consider implementing it in your plugin?

@creecros
Copy link
Owner

creecros commented Feb 2, 2021

between work, play, wife, and kids...I'll look into it. I make no promises.

@creecros
Copy link
Owner

creecros commented Feb 3, 2021

@korlikiangel

is the criteria, of "Type" being a number, or just look at all the field values and determine if they are numeric?

i have this working, by just looking at all the values and using is_numeric as the condition, which will include all numeric values, including values from custom dropdowns. But I could just limit it to Custom fields with the "Type" defined as "Number".

image

I did not do a date range filter, as of yet, already spent more time than I wanted...did you really need the range?

@creecros
Copy link
Owner

creecros commented Feb 3, 2021

The more I think about it, I think it should be based on the data type being a number.

i.e. Number has to be chosen in the Custom field settings:
image

otherwise, there could be foreseeable issues...

@creecros
Copy link
Owner

creecros commented Feb 3, 2021

@korlikiangel

Master Repo has been updated, test it out, let me know what you think (you will need to install via the master repo files).
https://github.com/creecros/MetaMagik/archive/master.zip

I'll wait for your feedback before making a new release.

@creecros
Copy link
Owner

creecros commented Feb 3, 2021

added one with a date range for creation dates as well, as requested.
image

@korlikiangel
Copy link
Contributor Author

korlikiangel commented Feb 5, 2021

Wow, I didn't expect you to do this so fast, thank you very much for implementing this solution, I also think that numerical values will be the best solution for these reports. While testing I noticed only one thing, in the report where there is an option to select a date range, we have to select the creation date from any date to a date in the future, it does not display the results if we select to today or to yesterday.

image

@creecros
Copy link
Owner

creecros commented Feb 5, 2021

b680a6e6ce9d64a0903c0a28fa1e75e4-1024x512

@korlikiangel
Copy link
Contributor Author

For example, no statistics are displayed if I select dates only for yesterday, or any other single day or range up to yesterday. If I select a range from earlier days to today it works. if I select statistics only for today it does not display the statistics either. However, the statistics for today will be displayed if I select dates from today to tomorrow.

@creecros
Copy link
Owner

creecros commented Feb 5, 2021

I already moved on to a new plugin I was working on, so might be a bit before I can get back to this one.

what I may need to do, is convert both back to dates, drop the times, convert back to Unix time, then add however many seconds in a day to the to date....
it sounds like today, is not necessary today in comparison to the creation time, since in reality, it's in Unix time, so even 1 sec difference would classify as tomorrow, for example.

@creecros
Copy link
Owner

creecros commented Feb 9, 2021

Exactly what I thought was going on, was going on. I didn't account for 2 things:

1.) Your timezone
2.) Time of the day.

I have corrected the code, to now, account for your timezone, and extend the full day on the to field. The from field will now account for timezone, but will continue to start at 00:00 hour of the day, since that is when the day begins.

Previously, if I chose today in my to field, which today is 2/9/2021, the unix timestamp was:
image

with corrected code, the new timestamp is:
image

I'm still 59 seconds off, but oh well, who makes tasks in the last 59 seconds of a day anyway....

@creecros creecros closed this as completed Feb 9, 2021
@korlikiangel
Copy link
Contributor Author

korlikiangel commented Feb 10, 2021

Hi,

Thank you very much for making the changes, I updated the plugin and the first "Custom field total distribution for open tasks" works, but if I try to access the second tab "Custom field total distribution with date range" I get this message, Internal Error: SQL Error: SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input syntax for type bigint: ""

I am using postgres as database

creecros added a commit that referenced this issue Feb 10, 2021
@creecros
Copy link
Owner

creecros commented Feb 10, 2021

i missed a commit, should be set now

I just remade the 1.4.11 release, https://github.com/creecros/MetaMagik/releases/tag/1.4.11, not going to tick it up to 1.4.12.

@korlikiangel
Copy link
Contributor Author

Works like a dream, thanks for your help and commitment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants