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: 
nwilliams
Contributor
Contributor

Display Current Months Data in 12 Month Dataset

Hi,

I think this is fairly easy, but can't figure it out.

I have a dataset that contains 12 months worth of headcount details.  I have created a bar chart that shows the count of all the heads by each month.  What I want is a straight table to show just the current months data, without having to make a selection.

Is this possible without detaching that bar chart or straight table, or using alternative states?

Thanks

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Neil Williams wrote:

=count({<[Headcount.Employment_Type] ={'UK - P'},[Calendar.MonthYear] ={"=MonthName(Today())"}>}Headcount.SAP_No)

Assuming the logic is correct, here is the syntax-correct expression:

=count({<[Headcount.Employment_Type] = {'UK - P'}, [Calendar.MonthYear] = {'$(=MonthName(Today()))'}>} Headcount.SAP_No)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein

View solution in original post

10 Replies
PrashantSangle

Hi,

Use calculated dimension in Straight table

month(Today())

and your expression.

Note: Match Your Month Pattern it is MonthYear then use MonthName(Today())

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nwilliams
Contributor
Contributor
Author

Struggling here. Getting "Error in set modifier"

=count({<[Headcount.Employment_Type] ={'UK - P'}, MonthName(Today())>}Headcount.SAP_No)

PrashantSangle

Hi,

Here you required Compared Field

like

=count({<[Headcount.Employment_Type] ={'UK - P'},DateCompareField ={"=MonthName(Today())"}>}Headcount.SAP_No)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nwilliams
Contributor
Contributor
Author

Still having issues.  The "MonthName" doesn't appear to be turning blue.  It returns the total for all 12 months

=count({<[Headcount.Employment_Type] ={'UK - P'},[Calendar.MonthYear] ={"=MonthName(Today())"}>}Headcount.SAP_No)

PrashantSangle

Hi,

Is it possible to share apps??

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
PrashantSangle

Hi,

I forgot to add $()

use below

=count({<[Headcount.Employment_Type] ={'UK - P'},[Calendar.MonthYear] ={"$(=MonthName(Today()))"}>}Headcount.SAP_No)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jonathandienst
Partner - Champion III
Partner - Champion III

Neil Williams wrote:

=count({<[Headcount.Employment_Type] ={'UK - P'},[Calendar.MonthYear] ={"=MonthName(Today())"}>}Headcount.SAP_No)

Assuming the logic is correct, here is the syntax-correct expression:

=count({<[Headcount.Employment_Type] = {'UK - P'}, [Calendar.MonthYear] = {'$(=MonthName(Today()))'}>} Headcount.SAP_No)

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
nwilliams
Contributor
Contributor
Author

Thanks,  so when I want to do previous month, I was trying to put a "-1" in, but this didn't seem to work.  The figure stayed the same.  The only thing I was thinking is this needs to be a year date field???

=count({<[Headcount.Employment_Type] ={'UK - P'}, [Calendar.Month] = {'$(=Month(Today(-1)))'}>}Headcount.SAP_No)

jonathandienst
Partner - Champion III
Partner - Champion III

'$(=MonthName(Today(), -1))'            --- for month year

'$(=Month(AddMonths(Today(), -1)))'  --- for month only

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein