Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
paulwalker
Creator III
Creator III

how to get current month records

how to get current month records

6 Replies
Not applicable

Hi,

Use Month(Today()), this gives you the current month.

rrsrini2907
Creator
Creator

Hi Paul,

Assuming Current month is the latest month for which the data is present.

If you want to get current month record at script level,

  1. find the max of Date and convert the date to month
  2. apply the filter on date by converting the date to month is equal to Month of max of Date.
  3. Execute the script.
  4. The data is loaded with the Latest data.
MayilVahanan

HI

You want to check both Year and Month to get the current Month data.

For ex:

Load * from tablename where Year = Year(Today()) and Month = Month(Today())

or

Load * from tablename where Date >= Date(MonthStart(Today()),'DD/MM/YYYY');

Note:

Date format based on your date field

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
brijesh1991
Partner - Specialist
Partner - Specialist

Hi,

You must have row updation date in your table; e.g we are considering it as LastUpdatedDate.

At Script Level:

TabMain:

Load ID, Amount, LastUpdatedDate, Month(LastUpdatedDate) as Month, year(LastUpdatedDate) as Year From Table;

Tab:

Load * resident TabMain where Month=Month(Today) and Year=Year(Today());

drop table TabMain;

------------------------------------------

At Expression Level:

Sum({$<Month={'$(=Month(Today()))'}, Year={'$(=Year(Today()))'}>}Amount)

MK_QSL
MVP
MVP

What type of records you want to get?

It is like total sale for this month or like Total Sale for each customer?

Please specify for more visibility.

paulwalker
Creator III
Creator III
Author

Hi Manish,

It is like total sale for this month