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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
ZoeM
Specialist
Specialist

Counting current month totals in Set Analysis Expression

Hi Community.

I have planned sales data in a monthly line chart from Jan to Dec.

I have the following expression and what I am trying to accomplish is to have a data point that shows the monthly total and changes as we go from month to month:

Count({$<[Date Type]={'VPP Dates'},Reference_Only={'No'},Date={$(=Date(Today(),'MMMM'))}>}Gateways)

I am getting zero when I throw the equation in a text box.

any help rendered will be truly appreciated. 

 

Labels (1)
1 Solution

Accepted Solutions
ZoeM
Specialist
Specialist
Author

I think I got it...

I will have to check tomorrow to see if the month will change to December, but thus far I am able to show as intended:

Dual('Current Month, '& Count({$<[Date Type]={'VPP Dates'},Reference_Only={'No'},[Month of Year Abbreviated Name]={$(=Date(Today(),'MMM'))}>}Gateways),
Count({$<[Date Type]={'VPP Dates'},Reference_Only={'No'},[Month of Year Abbreviated Name]={$(=Date(Today(),'MMM'))}>}Gateways) )

 

View solution in original post

15 Replies
dplr-rn
Partner - Master III
Partner - Master III

Date={$(=Date(Today(),'MMMM'))} will not work.
You either have to create a master calendar and do Set analysis against month field in the master calendar.
Or you will need to do something like below
Date={">=$(=MonthStart(Today()))"} , Date={"<=$(=Today())"}

Typing on my phone so may not perfect but you get the idea
ZoeM
Specialist
Specialist
Author

Thanks for the response.

I do have a master calendar and when I used your suggested formula, it said the expression was OK but I got a result of zero.

dplr-rn
Partner - Master III
Partner - Master III

Previous one you have to consider date format too I believe.
But
If you have a master calendar use set analysis on that along with month function
E.g. month={"$(=month(today ())"}

Share your expression of it doesn't work
ZoeM
Specialist
Specialist
Author

This is my Master Calendar data:

LOAD %Date,
Date,
Year,
[Quarter Number],
[Quarter Name],
[Month of Year],
[Month of Year Name],
[Month of Year Abbreviated Name],
[Week of Year],
[Day of Week],
[Day of Week Name],
[Day of Week Abbreviated Name],
[Day of Month],
[Day of Year],
[Days in Month],
Date(MonthStart(Date),'MMM YY') as YearMonth,
[Leap Year Flag],
[Weekend Flag],
[Production Month],
[Production Year],
[Issue Number],
[Julian Date],
[Week Ending Friday]

I tried using Month of Year:

=Date(Today(),'MMM')& ', '& Count({$<[Date Type]={'VPP Dates'},Reference_Only={'No'},[Month of Year]={"$(=[Month of Year](today ())"}>}Gateways)

It still didnt work. 

dplr-rn
Partner - Master III
Partner - Master III

Use same function on today as when you are creating yearmonth

 

Count({$<[Date Type]={'VPP Dates'},Reference_Only={'No'},[Month of Year]={"$(=Date(MonthStart(today()),'MMM YY')"}>}Gateways)

ZoeM
Specialist
Specialist
Author

Yes I tried that too and it still didn't work...

All I want to show is this months distribution and not every other month (YTD), currently the graph is showing Jan through Dec as the expression is a count of total planned for each month. 

dplr-rn
Partner - Master III
Partner - Master III

Sorry not Month of Year
YearMonth={"$(=Date(MonthStart(today()),'MMM YY')"}
ZoeM
Specialist
Specialist
Author

Nothing Dilipranjith, still nothing...

dplr-rn
Partner - Master III
Partner - Master III

weird. can you share the app? (anonymize if sensitive information exists)
in Qlikview - Settings - Document Properties - Scrambling
or
https://community.qlik.com/t5/Qlik-Design-Blog/Scrambling-Data/ba-p/1473042