Select Previous YearI'm in the process of automating some monthly reports, and am having trouble selecting the data I need. Suppose there is a column of dates. I would like a JSL script that selects the previous 12 months of data, based on the current month.
Example: We are in August 2021. I would like the script to select all dates from August 2020 to present. Next month when it is September I would like it to select September 2020 to present without any input from me.
How can I do this? Some other applications like Access and PowerBI have a "Select Previous Year" feature in their interface, but I can't find anything similar in JMP.
ScriptingRe: Select Previous YearOne way to do this is
dt = current data table();
dt << select where(:date >= DateMDY(month(today()),1,year(today())-1);<BR />dtSub = dt << subset(selected rows(1), selected columns(0));