Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

formula: Previous Year with inYearToDate function

Hello guys,

hope you can help me once more with a combination of this two formulas:

=

sum( {$ < Year= {$(=year(addyears(MaxOrderDate,-1)))}, CostumerType={Dritte} > } AmountSales)





=

sum(if(inYearToDate(InvoiceDate,MaxOrderDate,0) and CostumerType='Dritte' ,AmountSales))

What i want is: Qlikview should always calculate the Previous Year figures, when no selections then it is 2009 (currently), but they should be also considered, so when i select 2008, QV should bring 2007 figures. This function should be combined with an inYearTodate function.

So when (without selections) the MaxOrderDate is 22.10.10, i want the figures from 2009 as YTD 22.10.2009.

When i select 2009 (then MaxOrderDate becomes 31.12.2009, then i want the figures YTD per 31.12.2008.

What i tried is the following:



=sum( {$ < JahrBel = {$(=year(addyears(MaxOrderDate,-1)))}, Kundenart={Dritte} > } $(=if(inYearToDate(Fakturadat,MaxOrderDate,-1),WertOBIC)))

Suprise, Suprise it didnt work 🙂

Thanks for your ideas, i rely on your cleverness,

christoph





1 Solution

Accepted Solutions
Not applicable
Author

Hi Christoph,

please see the attached example for help.

Good luck!

Rainer

View solution in original post

2 Replies
Not applicable
Author

Hi Christoph,

please see the attached example for help.

Good luck!

Rainer

Not applicable
Author

Sorry for the late response Rainer, its busy budgeting time 🙂

I think your formula should do a great job, but I will use the yearstart - function instead of calculating 11 months back.

Hmm... lets see how i can do that

Thanks a lot for your fast and fitting response, Rainer!!