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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
Shir63
Contributor III
Contributor III

YoY Growth To Date

Hi,

I calculated the YoY Growth like so:

(sum({<[Qtr Diff] = {"$(=max([Qtr Diff]))"}>}(COUNT_U_SHAPED))
-
sum({< QTD = {'QTD'},  QuarterDateStart=$(vMaxDatePY)>}(COUNT_U_SHAPED)))

/
sum({< QTD = {'QTD'}, QuarterDateStart=$(vMaxDatePY)>}(COUNT_U_SHAPED))

 

and it works great. but when changing the date, i get "-".

how can i overcome this? make it adjustable for picking different Qtr-Year?

 

thank you! 

10 Replies
Shir63
Contributor III
Contributor III
Author

help is much appreciated 😀 

MayilVahanan
MVP
MVP

Hi @Shir63 

Can you say what is the vMaxDatePY definition? And also, are you assigning the values to QuarterDateStart, if so, you've missed the curly brackets like below.

sum({< QTD = {'QTD'},  QuarterDateStart={'$(vMaxDatePY)'}>}(COUNT_U_SHAPED)))

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

Hi Mayil,

vMaxDatePY = {"$(=date(QuarterStart(max([QuarterDateStart])-365),'DD/MM/YYYY'))"}

and yes you are correct, this is the correct formula i copied it with a missing bracket.

 

thanks

MayilVahanan
MVP
MVP

Hi @Shir63 

You need to exclude the time filter from ur expression. 

Like 

sum({< QTD = {'QTD'},  QuarterDateStart={'$(vMaxDatePY)'}, Date=, Month=, Year=>}(COUNT_U_SHAPED))

If its not works, can you share the sample file & expected o/p.

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

thank you for this suggestion.

when applying your suggest formula, it came back as a null.

i just need to understand why when choosing a different quarterdatestart, the result comes back as null?

here is a sample:

so for example if i change the quarterdatestart to 01/10/2020

i expect the calc to consider if it's QTD , and then sum the value of this year 100 - 130 / 130

Shir63
Contributor III
Contributor III
Author

Shir63_0-1614761784875.png

 

MayilVahanan
MVP
MVP

HI @Shir63 

If you select 1/10/2020, then ur expression will change like below

vMaxDatePY gives values of 01/10/2019. i.e.

sum({< QuarterStart={"01/10/2019"}>}(COUNT_U_Shaped)), so there is no value, it display "-" / null.

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

no it's just an example...

in my data I do have 01/10/2019.

MayilVahanan
MVP
MVP

Can you attach the sample file ?

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