matteoredaelli / strategico

Automatically exported from code.google.com/p/strategico
GNU General Public License v3.0
1 stars 1 forks source link

Managing projects with period.freq > 9 #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
A period.string (read/saved from/to database/csv/data.frames) is at the moment 
like 2011-10.

But sorting is problematic: "2011-10" < "2011-2"

(eval functions manage periods like (2011,10): they are 2 numbers, it is OK)

How solving it?

1) saving period string like 2011-02, using period.freq to understand how many 
0 ...

2) splitting period into 2 different fields (period.1 and period.2)

Original issue reported on code.google.com by matteo.redaelli on 17 May 2011 at 9:58

GoogleCodeExporter commented 9 years ago
In case of 1) solution, let's create 2 functions

Period.FromString         "2010-02" -> (2010,2)
Period.ToString           (2010,2)  -> "2010-02"

Original comment by matteo.redaelli on 17 May 2011 at 10:02

GoogleCodeExporter commented 9 years ago
I have created the two functions

Original comment by matteo.r...@pirellilabs.org on 18 May 2011 at 12:59

GoogleCodeExporter commented 9 years ago
Done

Original comment by matteo.redaelli on 18 May 2011 at 6:02