Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

gustavobelizari
New Contributor

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)

Tags (1)
1 Solution

Accepted Solutions
adityaakshaya
Contributor III

Re: Calculate the sum of the current month

Hi Gustavo,

Please use like below

Variable vCurrent_Month:

Month(Today())

Remove "=" before Month().

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

Regards,

Akshaya

4 Replies
tolberta14
New Contributor III

Re: Calculate the sum of the current month

=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
Contributor III

Re: Calculate the sum of the current month

Hi Gustavo,

Please use like below

Variable vCurrent_Month:

Month(Today())

Remove "=" before Month().

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

Regards,

Akshaya

jolivares
Valued Contributor

Re: Calculate the sum of the current month

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

agigliotti
Honored Contributor II

Re: Calculate the sum of the current month

you can use the below expression:

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


Hope it helps.