Reordering transactions

Derek Atkins warlord at MIT.EDU
Fri Oct 23 13:25:33 EDT 2009


Luiz Carlos da Costa Junior <lcjunior at ufrj.br> writes:

> Ok, I see...
>
> But in case of other data than integers what does it do? Ignore this field?
> Is it possible to put the transactions with non-integer NUM data at the end of
> the list and sort them?

No, the field is always converted to an integer first (using the C api
atoi()) and that is what gets compared.  So a non-numeric will be '0'.

This was done specifically to make sure that numeric comparisons work
correctly.  If you compare it as a string then '10' comes before '2',
which is just wrong.

> Best regards,
> LC

-derek

> 2009/10/21 Derek Atkins <warlord at mit.edu>
>
>     Expected.  It's treated as an integer.  So you should use HHMM, not HH:MM
>    
>     -derek
>
>     Quoting Luiz Carlos da Costa Junior <lcjunior at ufrj.br>:
>
>         Hi Derek,
>        
>         Since your post, I've been using a string that identifies the date as:
>         HH:MM
>         (hour:minute) in the NUM field but I realized that GnuCash doesn't
>         sort by
>         the NUM field correctly in case of alphanumeric data. For example, for
>         the
>         same date it sorts Transaction 1 with NUM = 22:10 before Transaction 2
>         with
>         NUM = 22:00 just because Transaction 1 was created before.
>        
>         Have you already noticed such behavior or is it expected?
>        
>         Thanks,
>         LC
>        
>         2009/10/12 Derek Atkins <warlord at mit.edu>
>
>             Luiz Carlos da Costa Junior <lcjunior at ufrj.br> writes:
>            
>             > Hi,
>             >
>             > Sometimes I add transactions for the same day but in the end
>             they are in
>             the
>             > wrong chronological order.
>             >
>             > As far as I know, gnucash orders the transactions in the same
>             day
>             according
>             > to the creation order.
>             > Is it possible to reorder transactions?
>            
>             Correct, the time entered is used.  But the actual order is:  Date
>             Posted, Num, Date Entered, Description, GUID, ...  So the NUM
>             column
>             will actually take precedence over the Date Entered column.  So,
>             put numbers into the 'num' column?
>            
>             > Thanks,
>             > LC
>            
>             > Please remember to CC this list on all your replies.
>             > You can do this by using Reply-To-List or Reply-All.
>            
>             -derek
>            
>             --
>                  Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>                  Member, MIT Student Information Processing Board  (SIPB)
>                  URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>                  warlord at MIT.EDU                        PGP key available
>
>     --
>          Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>          Member, MIT Student Information Processing Board  (SIPB)
>          URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>          warlord at MIT.EDU                        PGP key available
>

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord at MIT.EDU                        PGP key available


More information about the gnucash-user mailing list