Sorting for custom column


Author
Message
sitob80
sitob80
Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)
Group: Forum Members
Posts: 18, Visits: 105
Hi,

beside the time of the log entry we have some timing values in our log files that are logged as 1us, 200ms, 30s, >10min in the log file and provide as some more information about a running workflow. Now I've implemented a custom reader that
parses these settings and puts them into a column defined like this.
new FieldColumnInfo(ElementType.String, "Duration", true, 8, 25),

The parsing, displaying and filtering works, but what obviously doesn't work is the sorting of the log entries according to this column.
Next I've tried to implement the Column as
new FieldColumnInfo(ElementType.Timestamp,"Duration",true,12,50)
and convert our time to a timestamp. This time I get an additional column named "Relative" and not "Duration" that doesn't contain any values.

Personally for us it would be best to keep the string representation in the display and provide a custom sort algorithm that is used if someone clicks on the column.
So is there any way how I can achieve sorting for these kind of values?

Thank you very much
sitob80
LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Hi Sitob,

Writing the data to a String column should be fine.  When LogViewPlus sorts columns, it tries to convert the string data into a double representation.  I suspect the reason this was not working for you automatically, is because your data is not normalized and includes the data type (s, ms, u, etc...) making the data a string rather than a double.  So you will need to normalize the data into a standard integer representation. 

​In your case, it looks like you have fixed values, so you may just want to use an enumeration (1 - 8 for example).  Note that this data may be best displayed in a separate column.

Hope that helps,

Toby​​​​



sitob80
sitob80
Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)Junior Member (91 reputation)
Group: Forum Members
Posts: 18, Visits: 105
Hi Tobi,

converting the data to an integer representation and afterwards sort the columns works. Converting the data to double and sort doesn't work. Nevertheless converting them to integer is more or less useless for us. Having entries like 4, 16810, 13290000 are very, very hard to read or can you say immediately if the last one are 1.329, 13.29 or 132.9 seconds? So having at least double working would be good and the best would still be to have the possibility to define a custom sorter for this column. Then we could still go with the us, ms, and seconds display which would help us a lot.
So maybe you can put it in your backlog for one of the future versions.
I think for now I duplicate the columns once for displaying and once for sorting which obvious is a nasty workaround

Thanks & regards
  sitob80


LogViewPlus Support
LogViewPlus Support
Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)Supreme Being (5.3K reputation)
Group: Moderators
Posts: 1.1K, Visits: 3.7K
Thanks for letting me know about the sorting problem.  I will take a look and see how we can improve things.  In the meantime, it sounds like you have a working solution.

Thanks again,

Toby​​​​
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Login

Explore
Messages
Mentions
Search