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

Announcements
Catch up on the newest Qlik features and improvements: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate the sum of the current month

I need to calculate the sum of the current month:

Variable vCurrent_Month:

=Month(Today())

Sum({< Month_date = {"$(vCurrent_Month)"}>} Visitors)

1 Solution

Accepted Solutions
adityaakshaya
Creator III
Creator III

Hi Gustavo,

Please use like below

Variable vCurrent_Month:

Month(Today())

Remove "=" before Month().

sum({<Month_date ={'$(=$(vCurrent_Month))'}>}Visitors)

Regards,

Akshaya

View solution in original post

4 Replies
Anonymous
Not applicable
Author

=Month(Today()) is just going to give you 'May' as a result.

=Date(Today(),'MMM-YYYY') will give you the current month, just match the format string to month_Datesyntax.  The syntax is val

Edit: I've seen a lot of posts here recommending new syntax.  The syntax is valid, I worked it on my device. It's the output of the variable that's not matching whats in your dimension.

Andrew

adityaakshaya
Creator III
Creator III

Hi Gustavo,

Please use like below

Variable vCurrent_Month:

Month(Today())

Remove "=" before Month().

sum({<Month_date ={'$(=$(vCurrent_Month))'}>}Visitors)

Regards,

Akshaya

jolivares
Specialist
Specialist

You may use Num(Month(Today())) = 5

agigliotti
MVP
MVP

you can use the below expression:

Sum( {< Month_date = {"=Month(Today())"} >} Visitors )


Hope it helps.

The Power of shining a light on the dark side of your data.
Follow me on my LinkedIn | Know Gamma Informatica at gammainformatica.it