Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
marcus_steggall
Creator
Creator

Remove current Date's "month" from Script

Hi everyone, hope you're all well.

Hopefully a quick easy one, which I can't seem to get working.

Basically, I want a line of code in the script, that will ignore Today date's month.

So for example, we are 10 days into November and if we refresh a dashboard, I want this to show all data upto end of October.

No point, in showing data just for the first few days of November.

This way, the dashboard can automatically refresh each month.... safe in the knowledge, the data is only upto last month.

Any help, would be much appreciated.

Have a good day.

1 Solution

Accepted Solutions
sunny_talwar

With your sample data, try this:

LOAD Month,

  Period_Start_Date,

  Year

FROM

month.xlsx

(ooxml, embedded labels, table is Sheet1)

Where Period_Start_Date < MonthStart(Today());

View solution in original post

3 Replies
oknotsen
Master III
Master III

Add a where clause to your load script:

where someDate < MonthStart(today())

May you live in interesting times!
sunny_talwar

With your sample data, try this:

LOAD Month,

  Period_Start_Date,

  Year

FROM

month.xlsx

(ooxml, embedded labels, table is Sheet1)

Where Period_Start_Date < MonthStart(Today());

marcus_steggall
Creator
Creator
Author

Thanks both, ahhh to the MonthStart function.

Much appreciated, just what i required.