Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
jerryr125
Creator III
Creator III

Table Chart - set to only display dates within the current year/month

Hi - I would like to have a setting on a chart that defaults to only displaying the current month/year of data.

Example - SalesDate is in the table - only show records in which the SalesDate is in the current month/year.

Thoughts ? Jerry

8 Replies
vunguyenq89
Creator III
Creator III

You can apply Set Analysis to the measure expression of the chart. Check out this discussion https://community.qlik.com/t5/Qlik-Sense-App-Development/Set-analysis-current-month-and-year/td-p/11...

Hope it helps!

BR,

Vu Nguyen

jerryr125
Creator III
Creator III
Author

Hi - I looked at the link below - I am trying to add the formula to a table to only display the current months data.

That does not seem to do the trick - thoughts ? 

vunguyenq89
Creator III
Creator III

Which expression have you tried? Can you also post some sample data?

jerryr125
Creator III
Creator III
Author

Hi -

Thank you again everyone for your help !

Ok - for example :

I have the table visualization (chart)  on my sheet.

Display example :

SalesID        ProductName    SalesDate

123                 Shirt                       01/25/2019

456                 Cap                         11/06/2018

789                 Hoodie                  04/04/2019

534                 Jacket                    11/10/2019

 

I would like the table visualization (chart) to only display the following

SalesID        ProductName    SalesDate

534                Jacket                    11/10/2019

 

Therefore - only sales in the current year/month.

Thoughts ?? Jerry

vunguyenq89
Creator III
Creator III

You can create the expected table as follows:

  • Dimension = SalesID, ProductName
  • Measure = Only({<SalesDate = {">=$(=MonthStart(Today()))"}>} SalesDate)

BR, 

Vu Nguyen

jerryr125
Creator III
Creator III
Author

Hi - 

In the column (as a measure)

=Only({<([SalesDate]) = {">=$(=MonthStart(Today()))"}>} [SalesDate])

Does not work - thoughts ?

vunguyenq89
Creator III
Creator III

Check if field [SalesDate] in your data is really a date field, otherwise convert it to date.

Below is the reload script I used to create the test data

LOAD SalesID,ProductName, Date(Date#(SalesDate,'MM/DD/YYYY')) as SalesDate Inline [
SalesID,ProductName,SalesDate
123,Shirt,01/25/2019
456,Cap,11/06/2018
789,Hoodie,04/04/2019
534,Jacket,11/10/2019
];

With this data the above expression works

test.png

jerryr125
Creator III
Creator III
Author

HI - still not working - I created a column in my table (again - visualization chart) as a dimension - no luck - Jerryr

 

=Only({<SalesDate = {">=$(=MonthStartToday()))"}>} Sales.Date )