In the current world of needing to provide metrics to justify your existence, I have created a view from a user request approval system. Management wants to see how many tickets were approved in 1 day, 3 days or less and more than 3 days. No problem, I can get the view and have the tickets sorted by how long it took, by division.
Complete 1 Business Day
> Europe
ticket1 user approved date compdate
ticket2 user approved date compdate
> North America
ticket3 user approved date compdate
ticket4 user approved date compdate
Complete 3 Business Days or less
etc.
Here’s my problem:
Now they want to hit a button and show this week’s stats. Europe had 2 tickets complete in one day, 10 tickets complete with in 3 days, 1 ticket complete in greater than 3 days since the owner approved the ticket.
I even have been able to create a field that I hide on the report that has a 0 or 1, depending on whether or not it was completed this week. I’ve tried actions, and I’ve tried an agent. With the agent, I get it to re-read the view, but I can’t get it to tally and sort the 1’s in the field created for the view.
In the forum I’ve found the ViewCollapse, but it doesn’t really do what I want. Also, I’ve seen the notes in the forum about giving the temporary fields “programming names”, but I can’t seem to get these to work.
Subject: I’m narrowing it down - column name programmatic use
I have narrowed this down with further testing and prompts. In the agent, I seem to be able to read all of the records in the view. When I’m checking “field” columns for values, it finds them ok (eg. @If(Division = “Europe”). What it’s not doing correctly is checking “formula” columns. I changed the $1 to $MetricNum. My code checks to see if the metric num = 1. I try
@If($MetricNum = 1…
@If($MetricNum = ‘1’ …
@If(MetricNum = 1…
@If($MetricNum = ‘1’ …
@If (“$MetricNum” = 1 …
I also checked a definitely text field that was a formula column. I can’t seem to find the records when using the formula created columns. I’ve tried several things recommended in the forum, but can’t get past this.
Subject: RE: I’m narrowing it down - column name programmatic use
Changing the column name from the default is a good idea – using the dollar sign is a bad one. You should always rename computed columns when you create them, and give them meaningful names. “$”, “$$” and “%%” are reserved identifiers; never use them in your own code. Use something like “MetricNumCol” to indicate that it’s a column value and not a field (you’ll thank yourself for making that clear later in life). The formula would then be something like:
@If(MetricNumCol = 1; …)
that assumes that you are looking for a numerical 1. If the column computes to text, use “1” instead. Do not put quotes around the column name.
Subject: RE: I’m narrowing it down - column name programmatic use
Thanks for your help. It sure sounds logical, but I’m still not getting a display. I really want to do something with the data, but right now I’m just trying to see what the code is picking up.
This is the column name I change to : SAPMetricCol
For each European record, I’m getting a prompt with no data showing. I also used @Text(SAPMetricCol), just in case it was viewing it as a number. Same results.
Subject: RE: I’m narrowing it down - column name programmatic use
@Prompt? The only place you can use the column programmatic name (other than in the InViewEdit event) is in another view column. Outside of that context, it’s meaningless. Since you can’t use @Prompt in a view column, I have to assume that you’re trying to use the value outside the view. You can’t – you’ll need to use @DbLookup to get what’s in the column or recalculate the value yourself.
Subject: RE: I’m narrowing it down - column name programmatic use
In the view I was having trouble “rereading” the current view to count the number of approvals completed during the current week, so I created a button that executes an agent.
The records will show for the past month, but I want to display completion stats for the current week.
Maybe now that I have the column name down correctly, I can rethink how to approach this.