Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Load data till the last day of the previous month

Dear All,

I just want to add a where clause to my load script and I want to load all the data till the last day of the previous month.

Test:

Load

ID1,

amount,

Company_Code,

Document_Year,

DATE1,

Date(DATE) as Date

resident Entry

;


Thanks,

Rima

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

where DATE <= MonthEnd(today(1),-1);

View solution in original post

6 Replies
Anonymous
Not applicable
Author

where DATE <= MonthEnd(today(1),-1);

prma7799
Master III
Master III

Try this

Test:

Load

ID1,

amount,

Company_Code,

Document_Year,

DATE1,

Date(DATE) as Date

resident Entry

DATE <=  MonthEnd(today(),-1)

;


arvind_patil
Partner - Specialist III
Partner - Specialist III

Hi Rima,

Could you please try this one:

.

.

resident Entry Where  DATE < = monthEnd(Today(),-1);

Thanks,

Arvind Patil

Not applicable
Author

Thanks Robin for your answer,

I just want to add group by clause for the above expression

Test:

Load

ID1,

sum(amount) as Amount1,

Company_Code,

Document_Year,

DATE1

resident Entry

WHERE DATE1 <= MonthEnd(today(1),-1)

GROUP by ID1,Company_Code,Document_Year

;

but the result was "invalid expression " what am I missing?

Thanks,

Rima

tresesco
MVP
MVP

Your Group By clause is missing DATE1

Anonymous
Not applicable
Author

group by must contain every field / expression that won't be aggregated