Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Connect 2026! Turn data into bold moves, April 13 -15: Learn More!
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

pls help!!

3 Replies
Anonymous
Not applicable

try

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

Regards!

Jannet.

alexandros17
Partner - Champion III
Partner - Champion III

try with

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

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Since apparently vPYFromDate contains an expression to evaluate first, you'll have to do just that to get a real date value:

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

although this may not work either as TimeLine.Year may now be compared to a single full date value...