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: 
vvvvvvizard
Partner - Specialist
Partner - Specialist

Is there a way to optimize this expression


if(vDateView=1 and vMeasure=2 and vIFRS = 1 and v_Wastage=2 and v_Total=0,(Sum({<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO=, Acct_Type -= {'IFRS - Reversal'} >} CPV * Value_Used))/vRounding,
if(vDateView=1 and vMeasure=2 and v_Wastage=1 and vIFRS = 2 and v_Total=0,(Sum({<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO=,RecordType-={'WASTAGE - COSTING'}>} CPV * Value_Used))/vRounding ,
if(vDateView=1 and vMeasure=2 and v_Wastage=2 and vIFRS = 2 and v_Total=0,(Sum({<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO= >} CPV * Value_Used))/vRounding ,

if(vDateView=2 and vMeasure=2 and vIFRS = 1 and v_Wastage=2 and v_Total=0,(Sum({<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO=,Acct_Type -= {'IFRS - Reversal'}>} CPV * Value_Used))/vRounding,
if(vDateView=2 and vMeasure=2 and v_Wastage=1 and vIFRS = 2 and v_Total=0,(Sum({<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO=,RecordType-={'WASTAGE - COSTING'}>} CPV * Value_Used))/vRounding,
if(vDateView=2 and vMeasure=2 and v_Wastage=2 and vIFRS = 2 and v_Total=0, (Sum({<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO= >} CPV * Value_Used))/vRounding ,

if(vDateView=1 and vMeasure=2 and v_Total=10 and vIFRS = 1 and v_Wastage=2,Sum({<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO=, Acct_Type -= {'IFRS - Reversal'} >} CPV * Value_Used)/Sum(TOTAL <YR_MTH_NO>{<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO=, Acct_Type -= {'IFRS - Reversal'} >} CPV * Value_Used),
if(vDateView=1 and vMeasure=2 and v_Total=10 and v_Wastage=1 and vIFRS = 2,Sum({<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO=,RecordType-={'WASTAGE - COSTING'}>} CPV * Value_Used)/Sum(TOTAL <YR_MTH_NO>{<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO=,RecordType-={'WASTAGE - COSTING'}>} CPV * Value_Used) ,
if(vDateView=1 and vMeasure=2 and v_Total=10 and vIFRS = 2 and v_Wastage=2,Sum({<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO= >} CPV * Value_Used) /Sum(TOTAL <YR_MTH_NO> {<CAL_YEARMONTHINDEX={$(=Max(CAL_YEARMONTHINDEX))},MTH_SHORT_DESC=,FIN_YR_NO= >} CPV * Value_Used) ,

if(vDateView=2 and vMeasure=2 and v_Total=10 and vIFRS = 1 and v_Wastage=2, Sum({<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO=,Acct_Type -= {'IFRS - Reversal'}>} CPV * Value_Used)/Sum(TOTAL <YR_MTH_NO> {<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO=,Acct_Type -= {'IFRS - Reversal'}>} CPV * Value_Used),
if(vDateView=2 and vMeasure=2 and v_Total=10 and v_Wastage=1 and vIFRS = 2, Sum({<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO=,RecordType-={'WASTAGE - COSTING'}>} CPV * Value_Used)/Sum(TOTAL <YR_MTH_NO> {<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO=,RecordType-={'WASTAGE - COSTING'}>} CPV * Value_Used),
if(vDateView=2 and vMeasure=2 and v_Total=10 and v_Wastage=2 and vIFRS = 2 ,Sum({<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO= >} CPV * Value_Used) /Sum(TOTAL <YR_MTH_NO> {<FIN_YR_NO={$(v_Max_Year)},MTH_SHORT_DESC=,FIN_YR_NO= >} CPV * Value_Used)
))))))))))))

1 Reply
wade12
Partner - Creator II
Partner - Creator II

where possible, you should aim to code as much as feasible in the load script.

this will optimise performance on the front-end.

best wishes.