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: 
RichardLee
Creator
Creator

YTD Expression with a selected month

I have an expression of

Sum(if(year([NLtransactions.Month Name])=year(today()) and [Data Type]='Actual' and year([Date.Month Name])=year(today()) and MOnthName([NLtransactions.Month Name])<=MonthName([Date.Month Name]),TransactionValue))

 

I'm trying to get it to calculate the YTD but end at the month selected. This is giving me everything in my Data Table and not filtering by the lodgic on the expression. 

I have as a test the following too

Sum({$<[Year]={$(=max([Year]))}, Month={"<=$(=MonthEnd([Date.Month Name])))"} >}TransactionValue)

This gives me the current YTD but wont deduct the future months on the selected.

Any help will be amazing.

Labels (1)
1 Reply
vinieme12
Champion III
Champion III

Use the Date Field in your datamodel

 

=Sum( {< NLtransactions.DATEFIELD =  {">=$(=YearStart(Max(NLtransactions.DATEFIELD))) <= $(=Date(Max(NLtransactions.DATEFIELD))) "} >}  TransactionValue)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.