Jump to content
dil_bert

sorting a calc (or excel) datasheet to obtain a time based rank (with screenshot)

Recommended Posts

dear community, 

 

sorting a calc (or excel) datasheet to obtain a time based rank (with screenshot)

i need to sort the data (500 records) to get a time based rank -  see the column c on the right ... with the data: 

question: is this possible to sort the whole dataset with this category !? 

 

image.png.678c70d8e8e3857d7869e76824f9cf54.png

i look forwad to hear from you 

 

btw: have a great weekend  - 

yours dil_bert

Share this post


Link to post
Share on other sites

Export to a csv file and read the file with php and store in an array. From there ...

<?php
    $test = [  ['Module 1', '3 weeks ago'],
               ['Module 2', '2 months ago'],
               ['Module 3', '36 days ago'], 
               ['Module 4', '23 hours ago']
            ];
            
    usort ($test, function($a, $b) {
        return new DateTime($a['1']) <=> new DateTime($b[1]);
    });

    echo '<pre>', print_r($test, 1), '</pre>';
?>

Gives

Array
(
    [0] => Array
        (
            [0] => Module 2
            [1] => 2 months ago
        )

    [1] => Array
        (
            [0] => Module 3
            [1] => 36 days ago
        )

    [2] => Array
        (
            [0] => Module 1
            [1] => 3 weeks ago
        )

    [3] => Array
        (
            [0] => Module 4
            [1] => 23 hours ago
        )

)

 

  • Like 1

Share this post


Link to post
Share on other sites

Dear Barand - 

 

many thanks for your quick answer - youre the de-facto-database-expert here. 🙂

Outstanding - and great! 

 

Many thanks for all you do here.  its just great!! 

regards dil_bert

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.