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: 
prakhar_21
Contributor
Contributor

Optimizing the below chart expression

Hi all, I looking to optimize the below KPI expression for better app performance but couldn't figure out a solution. Your help is highly appreciated.  I just want to reduce the calculation since the same calculation is being repeated for all 5 cases. Is it possible to calculate only only time with the help of pick and match to increase the performance. This is the urgent requirement. Please help. 

 

if(GetSelectedCount(MONTH)=0 and GetSelectedCount(QUARTER)=0 and GetSelectedCount(FY)=0
and getselectedcount(DATE)=0,
((count({<MONTH={'$(curr_moonth)'},VAL_CDE*={"*abc"}>}VAL_CDE)/
count({1<MONTH={'$(last_month)'},VAL_CDE*={"*abc"}>}VAL_CDE))-1)*100,
if(GetSelectedCount(MONTH)=1 and GetSelectedCount(QUARTER)=0 and GetSelectedCount(FY)=0
and getselectedcount(DATE)=0,
((count({<VAL_CDE*={"*abc"}>}VAL_CDE)/
count({1<MONTH={'$(prev_month)'},VAL_CDE*={"*abc"}>}VAL_CDE))-1)*100,
if(GetSelectedCount(MONTH)=0 and GetSelectedCount(QUARTER)=1 and GetSelectedCount(FY)=0
and getselectedcount(DATE)=0,
((count({<VAL_CDE*={"*abc}>}VAL_CDE)/
count({1<QUARTER={'$(quarter_name)'},VAL_CDE*={"*abc"}>}VAL_CDE))-1)*100,
if(GetSelectedCount(MONTH)=0 and GetSelectedCount(QUARTER)=0 and GetSelectedCount(FY)=0
and getselectedcount(DATE)>=1,
((count({<DATE= {">=$(=date(min(DATE)))<=$(=date(max(DATE)+1))"},VAL_CDE*={"*abc"}>}VAL_CDE)/
count({1<DATE= {">=$(=date(min(DATE)-(max(DATE)-min(DATE))-1))<=$(=date(max(DATE)-(max(DATE)-min(DATE))))"},VAL_CDE*={"*abc"}>}VAL_CDE))-1)*100,
if(GetSelectedCount(MONTH)=0 and GetSelectedCount(QUARTER)=0 and GetSelectedCount(FY)=1
and getselectedcount(DATE)=0,
((Count({<MONTH= {">=$(=Yearstart(max(MONTH),0,4))<=$(=Yearend(max(MONTH),0,4))"},VAL_CDE*={"*abc"}>}VAL_CDE)/
Count({1<MONTH={">=$(=Yearstart(max(MONTH),-1,4))<=$(=Yearend(max(MONTH),-1,4))"},VAL_CDE*={"*abc"}>}VAL_CDE))-1)*100)))))

 

4 Replies
Chanty4u
MVP
MVP

first simplify your expression.

keep every set expression into variable and replace it for all expressions then keep final expression also into a variable  and use that variable into your expresssion.

prakhar_21
Contributor
Contributor
Author

I guess replacing the set expression will just simplify the expression but won't help in optimization. 

Chanty4u
MVP
MVP

Have you tried ?  is it still same issue?

prakhar_21
Contributor
Contributor
Author

Yes same issue. Any possible solution where we can use pick and match to optimize the apps performance. So that the KPI charts get loaded quickly. Like there are many if statements used that is causing the problem.