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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
aarav021
Contributor III
Contributor III

How to optimize 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.

NOTE-: I want to optimize the expression for better app performance I don't want to simplify the expression. 

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)))))

1 Solution

Accepted Solutions
1 Reply
Or
MVP
MVP