I have a database and would like to create a view, which orders by date (Q1, Q2, Q3, Q4) I am not a developer so I was wondering if there is any easy solution for that or if it has to be programmed.
Thanks
Hans
I have a database and would like to create a view, which orders by date (Q1, Q2, Q3, Q4) I am not a developer so I was wondering if there is any easy solution for that or if it has to be programmed.
Thanks
Hans
Subject: I need a view to order by quarter of year!
You can get the month the documents are created by using @Month(@created)
The Categorized Column would look something like:
quarter :=@Month(@Created);
@If(@Contains(quarter ; 1:2:3) ; “Q1” ;
@Contains(quarter ; 4:5:6) ; “Q2” ;
@Contains(quarter ; 7:8:9) ; “Q3” ;
@Contains(quarter ; 10:11:12) ; Q4 ; "Error in quarter)
Subject: RE: I need a view to order by quarter of year!
Thanks, I will try that, I really appreciate the quick response.
Subject: RE: I need a view to order by quarter of year!
Date comparisons in views have a large affect on performance. If you are looking at a large number of docs, it might be worth speaking to your developer to get a computed field put onto the form, so that you can just compute the quarter on the form, and display this value in the view.
Subject: Not quite correct!
Date comparisons as such are no heavier than any other formulas in a formula.
However, using @Now or @Today in a view selection formula, which forces the view to be re-indexed each time it is opened, puts a heavy strain on the server (and perceived performance)
Subject: RE: Not quite correct!
While it’s true that date calculations in general are not much worse than working with other data types provided @Now and @Today are not used, still the formula that was posted before is not a very well-performing one – plus I’m not sure it’ll work, since @Contains is a string function, not number. Here’s an alternative:
“Q” + @Text(@Integer((@Month(@Created)+2)/3))
Of course the name of a date field could be substituted for @Created. A willingness to do a little math can often save a lot of typing and improve speed.
Subject: RE: Not quite correct!
Andre,thanks for your tip. It works great.
Thanks all of you for all the tips…
Subject: RE: I need a view to order by quarter of year!
You only get the date/time performance hit if a date or time you are comparing with is changing every time the view is indexed, e.g. using @now.
The example given will not have that problem.