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: 
DGAL1
Contributor III
Contributor III

DISPLAY ONLY THE PAST MONTHS

Hello, how do I edit to only have January to the  on going month and exclude the future months that show -100% for this comparison.

This is my measure 

(
SUM(IF(YEAR(TRANSACTION_DATE)=vCY,AMOUNT))-SUM(IF(YEAR(TRANSACTION_DATE)=vPY,AMOUNT))
)
/
SUM(IF(YEAR(TRANSACTION_DATE)=vPY,AMOUNT))

 and this is my dimension

=[TRANSACTION_DATE.autoCalendar.Month]

DGAL1_0-1716265626704.png

 

Labels (3)
4 Replies
steeefan
Luminary
Luminary

You can use set analysis to achieve that: Avg({<Date = {"<=$(=Today())"}>} ValueField). This will only values from before Today().

TauseefKhan
Creator II
Creator II

To display only the past months and exclude future months in your measure, you can use Qlik's Set Analysis to limit the data to the current date.

Dimension:
=If(Month(TRANSACTION_DATE) <= Month(Today()), Date(MonthStart(TRANSACTION_DATE), 'MMM'))


Measure:
(
Sum(If(Year(TRANSACTION_DATE) = vCY AND Month(TRANSACTION_DATE) <= Month(Today()), AMOUNT)) -
Sum(If(Year(TRANSACTION_DATE) = vPY AND Month(TRANSACTION_DATE) <= Month(Today()), AMOUNT))
) / Sum(If(Year(TRANSACTION_DATE) = vPY AND Month(TRANSACTION_DATE) <= Month(Today()), AMOUNT))

*** When applicable please mark the correct/appropriate replies as "solution". Please LIKE threads if the provided solution is helpful to. ***

BrunPierre
Partner - Master
Partner - Master

I get that you're calculating the year-over-year percentage change.

=((Sum({$<Date={"$(='>='& Date(YearStart(Max(TRANSACTION_DATE)))&'<='Date(Max(TRANSACTION_DATE)))"},Year,Quarter,Month,Week>} AMOUNT)
-
Sum({$<Date={">=$(=YearStart(Max(RANSACTION_DATE), -1))<=$(=AddYears(Max(RANSACTION_DATE),-1))"},Year,Quarter,Month,Week>} AMOUNT))
/
Sum({$<Date={">=$(=YearStart(Max(RANSACTION_DATE), -1))<=$(=AddYears(Max(RANSACTION_DATE),-1))"},Year,Quarter,Month,Week>} AMOUNT))

DGAL1
Contributor III
Contributor III
Author

All the above have not worked for me but in  the limit of time for my ppt , this simple filter on the meause has helped me

DGAL1_1-1716286470453.png