tableau-apitableau-desktop

Getting rolling sum without using a window_function?


I have a list of terminations by month, and I'm trying to get each row to show the running total from YoY by month. Example: January 2024 should sum up Feb 2023 - Jan 2024 terms, not just show terms for each month like it does here: enter image description here

I want it to look like this: enter image description here

I've tried utilizing a Fixed LOD, but it still just gives me the count for each month, not total terms for past year month by month:

{FIXED [Date]: 
IF 
    MIN([Date])>=DATE(DATEADD('month',-12,MIN([Date])))
    AND MIN([Date])<=DATE(DATEADD('month',0,MIN([Date])))
THEN 
    [All Terms]
END
}

Solution

  • Tableau Desktop's LOD calcs won't work for this, as they operate on partitions of the input data records -- where each data record is assigned to only a single partition. In Tableau Desktop, table calcs such as WINDOW_SUM() are the only type of calculation that can depend on the order of records.

    Confusingly, Tableau Prep supports something called LOD calcs that can be more flexible than LOD calcs in Tableau Desktop, and can do rolling sums.

    So your choices are: