Hi. i took a stab at it. The main question is that your date periods cover different time periods with different granularity. Current month has days, prior 12 months has months and quarterly summaries, prior years only have years.
i just loaded all 'as is' so in a single list box you can pick a prior year and a day from the current month for example.
You'll need to think through how these values are calculated before trying to convert them to dates for example.
But the script technique should help. One of the things i did was convert the days to dates and leave the rest.
I really like your approach with a very compact usage of wildmatch/pick functions.
I am curious about why you use the 'right join towards the distinct load' in this case? Is this like a double-check to avoid any other fields in the final table? And if so, would you not rather like to see those fields that aren't considered yet?
I wanted to join the FieldName and Dimension fields to the tabInput table anyhow and so it's just been a nice opportunity to get rid of the crosstable rows created by the Total column of the source xls.