Skip to main content
Announcements
Live today at 11 AM ET. Get your questions about Qlik Connect answered, or just listen in. SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
reporting_neu
Creator II
Creator II

Period like current month // period last three months

Hello togehter,

I have a column with the monthly periods (1, 2, 3, ...) and a column with values.

Column1 = Period (1, 2, 3, ...)
Column2 = MVerb (1215, 545464, 45889)
Column3 = Part

Example source:

PeriodMVerbPart
121001
251001
361001
481001
5111001
151002


I need the sum of the current month (period = current month) and the sum of the last three months (period = last three months).

Assuming that the current month is May, i.e. 5, the first formula should be: Period = month (today) -> 5)

The second formula: period between 4 and 2, based on today (5).

Result:

current monthlast three monthtotalpart
1119321001
5-51002

 

How can I get the sum of period, if the current month is always to be used for the calculation?

I hope you can helf me 😄

Labels (1)
1 Solution

Accepted Solutions
rubenmarin

Hi, current month can by: Sum({<Period={$(=Num(Month(Today())))}>} MVerb)

Previous 3 months: Sum({<Period={">=$(=Num(Month(Today()))-3)<=$(=Num(Month(Today()))-1)}>} MVerb)

If you want to mix differnt years you will need a period field that includes year and month.

Btw: your Result table shows 5 for 1002 part, and it's period is '1', not '5'

View solution in original post

1 Reply
rubenmarin

Hi, current month can by: Sum({<Period={$(=Num(Month(Today())))}>} MVerb)

Previous 3 months: Sum({<Period={">=$(=Num(Month(Today()))-3)<=$(=Num(Month(Today()))-1)}>} MVerb)

If you want to mix differnt years you will need a period field that includes year and month.

Btw: your Result table shows 5 for 1002 part, and it's period is '1', not '5'