Forum Discussion

danialsj's avatar
danialsj
Frequent Visitor
6 years ago

Month Sort by Column not working with Top N

I want to create some visuals that only display data from the latest month. I am currently using Top N which helped me last month (September) but I realized it was only giving me September data because 'S' is alphabetically last. 

 

Things I have already done:

  • Created an index for the date table and sorted the column by index
  • Created a relationship between the date table and the fact table
  • Changed the index to 'Whole Number'

 

Data:

Fact Table

ID         Score    Month    

1001     78         September

1002     89         February

1003     09         October

 

Month (Lookup Table)

Index    Month

1           January

2           February

3           March

4           April

.........cont.

 

 

 

1 Reply

  • nandukrishnavs's avatar
    nandukrishnavs
    Icon for Community Champion rankCommunity Champion

    Hi danialsj,

    Try to create a conditional column in the Fact table using Edit query mode. That can be an index value or corresponding date field. 

    Under the Modelling tab, you can change the sort order (choose newly created conditional column). 

     

    If you are creating a date field, you can filter the visual using Top N and select By value as "Latest Date".

     

    Regards,

    Nandu Krishna