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

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum Set of Data Dynamically By Date

Hi All,

I'm new to QlikView and need pointed in the right direction.

I have added Straight Table Chart with a list of Invoice numbers and an Expression Column to display the Invoice Total for the current Month.

I have one dimension [Invoice Number]

My Expression column is as follows:

Label - "Current Month Total"

Expression - =Sum ( { $ < [Invoice Date] = { "2010-05*" } > } [Invoice Amt])

The Straight table will then display all invoice numbers and the total for the current month as expected.

This is a problem because I need to amend the Dimension every month to keep it up to date. What I want to do is dynamically create the filter for the current month. I have tried the following but is causes errors in the Expression Editor:

=Sum ( { $ < [Invoice Date] = { mid(today(1), 7,4) & mid(today(1), 4, 2) & "*" } > } [Invoice Amt])

Thanks in Advance,

Sean

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

I found a solution, don't know if it is the best way though! I created a variable called currentMth

where currentMth = "'&mid(today(1), 7,4) & '-'& mid(today(1),4, 2)&'*"'

Then in my set analysis expression column I did the following:

=Sum ( { $ < [Invoice Date] = {$(currentMth)} > } [Invoice Amt])

It dynamically changes the result based on the current month.

View solution in original post

3 Replies
spsrk_84
Creator III
Creator III

Hi,

Instead of passing date Directly break the Invoice date into Invoice year and Invoice Month

write the expression like this dynamically

Sum ( { $ < [Invoice Year] = { Max(Year(InvoiceDate) } ,

{ Invoice Month] = { Max(Month(InvoiceDate)}, > } [Invoice Amt])

see this expression gives result by default fot current year and current month

Check this

Regards,

Ajay

Not applicable
Author

Hi Ajay,

Thanks for the reply, but it appears that the Set does not like functions in the filter. The error that appears is:

Bad Field Name(s): Max

Any thoughts?

Sean

Not applicable
Author

Hi,

I found a solution, don't know if it is the best way though! I created a variable called currentMth

where currentMth = "'&mid(today(1), 7,4) & '-'& mid(today(1),4, 2)&'*"'

Then in my set analysis expression column I did the following:

=Sum ( { $ < [Invoice Date] = {$(currentMth)} > } [Invoice Amt])

It dynamically changes the result based on the current month.