Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
eyadelnagdy
Contributor II
Contributor II

Calculate the month to date value

Hello Everyone, I have a question for Qlik sense. I have a table that has a Date column and a quantity column. I need to create a master Item that calculates the month to date quantity. 

I am attaching an Excel file that has those 2 columns and also the column of the MTD that I need to calculate as a master item

Can you please Help ?. Thanks

 

Labels (1)
9 Replies
BrunPierre
Partner - Master
Partner - Master

=Sum({<Date={">=$(=MonthStart(Max(Date)))<=$(=AddMonths(Max(Date)))"}>} quanity)

eyadelnagdy
Contributor II
Contributor II
Author

unfortunately not working

BrunPierre
Partner - Master
Partner - Master

Works pretty fine for me.

BrunPierre_0-1715179248176.png

eyadelnagdy
Contributor II
Contributor II
Author

eyadelnagdy_0-1715237798084.png

the values should add up day by day in the 5 months but the measure just add the last value 53.

 

 

BrunPierre
Partner - Master
Partner - Master

Disable the expression without the set expression to see if it really works.

eyadelnagdy
Contributor II
Contributor II
Author

how can I do that. Excuse me, I am new to Qlik 

BrunPierre
Partner - Master
Partner - Master

The MTDPlanned2 expression calculates the sum of the Quantity field for all dates falling within the current month, starting from the first day of the month up to the maximum date in the dataset.

Apart from 6/10/2024, is there any data available for the current month of 'June' in the dataset?

eyadelnagdy
Contributor II
Contributor II
Author

I need the measure to calculate the sum of quantity from the start of the month untill the current date in the table. for example on 10/05/2024 I need the sum of quantity from 01/05/2024 until 10/05/2024 so That I can create a line chart that keeps growing because it keeps adding values day by day. 

in the current data set this is just only data in june. Thanks

BrunPierre
Partner - Master
Partner - Master

This expression dynamically adjusts the date range based on the current date, ensuring that the line chart keeps growing as new data is added day by day.

=Sum({$<DateField = {"$(='>=' & Date(MonthStart(Max(DateField))) & '<=' & Date(Max(DateField))"}>} Quantity)