Loading...

Custom Sorting

Custom Sorting

Many of the reports customers need involve data that are sorted by month. Let us take a ‘Sales by Month’ report.

When you create this in Yellowfin, it might seem easy enough to do… but then you see that the names of the months are sorted incorrectly. You might already know that Yellowfin sort it’s data in alphabetical order – so how can you fix this so that your months appear chronologically?

To sort the months in chronological order (January, February, March and so on) you need to use Reference Codes in Yellowfin.

Reference codes enables you to do quite a few cool things in Yellowfin. For example, to translate a value held in the database to more a meaningful value. Reference Codes also give you the ability to assign a custom sort order to your data and define custom colours and images to values in your database.

Below there are steps that you can follow to assign a custom sort order to your data.

  1. Create a new report based on the Ski-Team view. This is part of the tutorial content that can be installed when installing Yellowfin.

  2. Add the Month (Dim) and Invoice Amount fields to the columns area.

    Create new report

  3. You will notice that the months are sorted in alphabetical order, starting with April.

  4. Open the column formatting menu through the field drop down arrow or the column formatting menu at the top of the page.

    Edit Settings

  5. Change the format to Reference Code.

    Change format to reference code

  6. A new Reference Type option will appear. Click on “Create New” link.

    Create New Link

  7. Enter a name for the reference type, enable custom sort and click on define values.

    Create new Reference code

  8. You can now add the values using the screen below. You can manually enter the values, populate the values from your data source or from a CSV file. Click on the “Populate from data source” link, this will return all the unique Month (Dim) values from the data source.

    Reference code values

  9. After the data is returned from the data source, you can add your custom sort order next to the month names and click on Save.

    Sort order

  10. Confirm that your new reference type is selected and close the column formatting menu.

    Close Column Formatting

  11. Your data will now be sorted in chronological order.

    Sorted data

This can be applied to sort any field in your report.