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: 
arusanah
Creator II
Creator II

help with expression

I have a variable vFromDate, which i use to calculate current year sales.

i haanother Variable  vPYFromDate which i am using to calculate prev years sale

vPYFromDate = 'AddYears(vFromDate,-1)'

i'm trying to write an expression but doesn't work

=SuM({$<TimeLine.Year={$(vPYFromDate)}>}(Fact.CustomerSales*$(=CurrencyField)))

throws error in set modifier

________________________

if i use following expression gives me sale  for 2014

what if  i want to  pic max year from  variable vFromDate:

Sum({$<TimeLine.Year={$(=max(TimeLine.Year)-1)}>}(Fact.CustomerSales*$(=CurrencyField)))

how can i modify this to take value from vFromdate

Pls Help

1 Reply
MK_QSL
MVP
MVP

vPYFromDate = AddYears(vFromDate,-1)