Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Archlite
Contributor
Contributor

Getting dataset for specific month

I have a table where one of the columns just needs to display the count for all the records that occur in the current month. However, my current expression is returning all the records that contains any date data for [DATE_FIELD_A].

My current expression for this particular column is:

=Count(If(Month(Today()=Month([DATE_FIELD_A])),[DATE_FIELD_A]))

Logic:

Select count where [DATE_FIELD_A] is = CurrentMonth

Labels (1)
1 Solution

Accepted Solutions
Archlite
Contributor
Contributor
Author

This zero'd out my data for the column but I appreciate the help.

I was able to get it working by creating a variable in the load script to evaluate the date field against current month and return a 1/0 value. We just filter out all non-matched dates in the sheet column expression.

In load script:

If(MonthStart([DATE_FIELD_A])= MonthStart(Today()),1,0) as COD_InMonth,

In column expression:

=Count({<COD_InMonth={1}>}[DATE_FIELD_A])

 

Solution used was taken from 'johnca':

https://community.qlik.com/t5/QlikView-App-Dev/How-to-show-data-for-the-current-month-only/m-p/97779...

View solution in original post

2 Replies
BrunPierre
Partner - Master
Partner - Master

Count({< [DATE_FIELD_A]= {"$(='>=' & Date(MonthStart(Max( [DATE_FIELD_A]))) & '<=' & Date(Max( [DATE_FIELD_A])))"}>} [DATE_FIELD_A])

Archlite
Contributor
Contributor
Author

This zero'd out my data for the column but I appreciate the help.

I was able to get it working by creating a variable in the load script to evaluate the date field against current month and return a 1/0 value. We just filter out all non-matched dates in the sheet column expression.

In load script:

If(MonthStart([DATE_FIELD_A])= MonthStart(Today()),1,0) as COD_InMonth,

In column expression:

=Count({<COD_InMonth={1}>}[DATE_FIELD_A])

 

Solution used was taken from 'johnca':

https://community.qlik.com/t5/QlikView-App-Dev/How-to-show-data-for-the-current-month-only/m-p/97779...