Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Annualized Expression

I have an expression that gives a 2012 YTD sum, but I want to create another expression to annualize that sum based on the current day that the user looks at the data (to avoid me having to go in and change the expression all the time). Is there an easy way to do this within the expression?

The 2012 YTD expression is as follows:

sum({$<Year={2012},ContractStartDate={'>=1/1/2010
12:00:00 AM<=12/31/2012 12:00:00 AM'}>}
FeeOne)+sum({$<Year={2012},ContractStartDate={'>=1/1/2010
12:00:00 AM<=12/31/2012 12:00:00 AM'}>}
FeeTwo

5 Replies
Not applicable
Author

you can use variables and expressions in set analyses

f.ex.

sum({$<Year={'$(=year(today()))'},ContractStartDate=......

Not applicable
Author

Is this what you mean?

sum({$<Year={'=year(today())'},ContractStartDate={'>=1/1/2010
12:00:00 AM<=12/31/2012 12:00:00 AM'}>}
FeeOne)+sum({$<Year={'=year(today())'},ContractStartDate={'>=1/1/2010
12:00:00 AM<=12/31/2012 12:00:00 AM'}>}
FeeTwo

Not applicable
Author

use $ sign

Year={'$(=year(today()))'}

i don't know what you want to get at the end:)

you sholud write more information about your table/expression


Not applicable
Author

When I use the $ sign, I get the same values as the YTD column. What I want to do is take what we have done so far (until today's date)and annualize it so that I can compare it to previous years.

MayilVahanan

Hi,

     What your requirement, can you say clearly,from selected date to today date want to calculate the values ??

    

sum({$<ContractStartDate={'>=$(=Max(ContractStartDate)) <=$(=today())'}>}FeeOne)+sum({$ContractStartDate={'>=$(=Max(ContractStartDate)) <=$(=today())}'>}FeeTwo

Hope it helps

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.