Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
sagaraperera
Creator
Creator

LAST MONTH OF LAST YEAR

Dear ALL

Hi , I have the following expression to obtain Last Year based on the selected Month:

sum( {$<TRAN_YEAR= {"$(=Only([TRAN_YEAR]-1))"},DESCRIPTION= {'NRP'} >} [Actual])

But, when the selected Month = January, it does not change the Month.

The correct result should be November of the past year

3 Replies
arulsettu
Master III
Master III

try this

sum( {$<TRAN_YEAR= {"$(=Max([TRAN_YEAR]-1))"},DESCRIPTION= {'NRP'} >} [Actual])

sagaraperera
Creator
Creator
Author

Dear Mr.Arul

IT IS COME TO LAST YEAR SAME MONTH BUT I WANT TO LAST YEAR PREVIOUS MONTH VALUE

SELECT DEC 2016

I WANT

VALUE OF NOV 2015

SAGARA

arulsettu
Master III
Master III

maybe try this

use your date field

sum( {$<DATE_FIELD= {"$(=AddMonths(Max(DATE_FIELD),-13))"},DESCRIPTION= {'NRP'} >} [Actual])