How to sort starting with the current month

When we sort chronologically - it starts with January - December


How can we sort so that the first row is always the current month, like in this screenshot:

f384113a-7877-4a15-a9f0-32c3cc888014.png
Sort starts on July (article written on 7/15/202​​1)

We can sort on a table calculation (which we will hide from the visualization so it doesn’t get plotted)

If the month column’s value > current month (ex. Row 2, August > July evaluates to true)
we'd take the month_num and subtract the current month value (8 - 7)
If not, we would add them (ex. Row 9, March > July evaluates to false, we’ll take 3 + 7)

The table calc syntax looks something like this:

if(
${orders.order_month_num} >= extract_months(now()),
${orders.order_month_num} - extract_months(now()),
${orders.order_month_num} + extract_months(now())
)
0 0 694
0 REPLIES 0
Top Labels in this Space
Top Solution Authors