Optimize interface code so that the queryentity is called as minimal as possible

Hi All,

     i have written an interface code , which calls an query entity multiple time , because of which sometimes am facing Query timeout issue, Please help me in Optimizing the code

with(
a!localVariables(

local!dcSelectedrole : ri!dcSelectedRole,
/*super admin variables starts*/
local!superadminPOCdata: if (rule!APN_isBlank(ri!programId),
{},
rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "POC",
typeValue: "1"
).data

),
local!superadminNonPOCdata: if (rule!APN_isBlank(ri!programId),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "POC",
typeValue: "2",
pagingInfo: ri!paginginfo
).data),
local!superadminGenderFdata: if (rule!APN_isBlank(ri!programId),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "GENDER",
typeValue: "1",
pagingInfo: ri!paginginfo
).data),
local!superadminGenderMdata: if (rule!APN_isBlank(ri!programId),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "GENDER",
typeValue: "2",
pagingInfo: ri!paginginfo
).data),
local!superadminRegionUSdata: if (rule!APN_isBlank(ri!programId),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "REGION",
typeValue: "USA",
pagingInfo: ri!paginginfo
).data),
local!superadminRegionEMEAdata: if (rule!APN_isBlank(ri!programId),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "REGION",
typeValue: "EMEA",
pagingInfo: ri!paginginfo
).data),
local!superadminRegionAPACdata:if (rule!APN_isBlank(ri!programId),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "REGION",
typeValue: "APAC",
pagingInfo: ri!paginginfo
).data),
local!superadminRegionCANdata: if (rule!APN_isBlank(ri!programId),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "REGION",
typeValue: "CAN",
pagingInfo: ri!paginginfo
).data),
local!superadminRegionLATAMdata: if (rule!APN_isBlank(ri!programId),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "SuperAdmin",
programId: ri!programId,
type: "REGION",
typeValue: "LA",
pagingInfo: ri!paginginfo
).data),
/*Super admin variables end*/

/*SBG CL/HRVPS Variables starts*/

local!sbgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "POC",
typeValue: "1",
sbg: ri!sbg,
pagingInfo: ri!paginginfo

).data),
local!sbgNonPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "POC",
typeValue: "2",
sbg: ri!sbg,
pagingInfo: ri!paginginfo
).data),
local!sbgGenderFdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "GENDER",
typeValue: "1",
sbg: ri!sbg,
pagingInfo: ri!paginginfo
).data),
local!sbgGenderMdata:if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "GENDER",
typeValue: "2",
sbg: ri!sbg ,
pagingInfo: ri!paginginfo
).data),
local!sbgRegionUSdata:if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "REGION",
typeValue: "USA",
sbg: ri!sbg,
pagingInfo: ri!paginginfo
).data),
local!sbgRegionEMEAdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "REGION",
typeValue: "EMEA",
sbg: ri!sbg,
pagingInfo: ri!paginginfo
).data),
local!sbgRegionAPACdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "REGION",
typeValue: "APAC",
sbg: ri!sbg,
pagingInfo: ri!paginginfo
).data),
local!sbgCANdata:if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "REGION",
typeValue: "CAN",
sbg: ri!sbg,
pagingInfo: ri!paginginfo
).data),
local!sbgLATAMdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!sbg)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "CL",
programId: ri!programId,
type: "REGION",
typeValue: "LA",
sbg: ri!sbg,
pagingInfo: ri!paginginfo
).data),

/*SBG CL/HRVPS Variables END*/

/*Nominators Variables starts*/

local!nomPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "POC",
typeValue: "1",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo

).data),
local!nomNonPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "POC",
typeValue: "2",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo
).data),
local!nomGenderFdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "GENDER",
typeValue: "1",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo
).data),
local!nomGenderMdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "GENDER",
typeValue: "2",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo
).data),
local!nomRegionUSdata:if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "REGION",
typeValue: "USA",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo
).data),
local!nomRegionEMEAdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "REGION",
typeValue: "EMEA",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo
).data),
local!nomRegionAPACdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "REGION",
typeValue: "APAC",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo
).data),
local!nomCANdata:if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "REGION",
typeValue: "CAN",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo
).data),
local!nomLATAMdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!nominatoreid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "NOM",
programId: ri!programId,
type: "REGION",
typeValue: "LA",
nominatorEID: ri!nominatoreid,
pagingInfo: ri!paginginfo
).data),


/*Nominator Variables END*/
/*HRG Variables starts*/

local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "POC",
typeValue: "1",
hrgeid: ri!hrgeid,
pagingInfo: ri!paginginfo

).data),
local!hrgNonPOCdata:
local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "POC",
typeValue: "2",
hrgeid: ri!hrgeid,
pagingInfo: ri!paginginfo
).data),
local!hrgGenderFdata:
local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "GENDER",
typeValue: "1",
hrgeid: ri!hrgeid,
pagingInfo: ri!paginginfo
).data),
local!hrgGenderMdata:
local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "GENDER",
typeValue: "2",
hrgeid: ri!hrgeid,
pagingInfo: ri!paginginfo
).data),
local!hrgRegionUSdata:
local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "REGION",
typeValue: "USA",
hrgeid: ri!hrgeid
).data),
local!hrgRegionEMEAdata:
local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "REGION",
typeValue: "EMEA",
hrgeid: ri!hrgeid,
pagingInfo: ri!paginginfo
).data),
local!hrgRegionAPACdata:
local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{}, rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "REGION",
typeValue: "APAC",
hrgeid: ri!hrgeid,
pagingInfo: ri!paginginfo
).data),
local!hrgCANdata:
local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "REGION",
typeValue: "CAN",
hrgeid: ri!hrgeid,
pagingInfo: ri!paginginfo
).data),
local!hrgLATAMdata:
local!hrgPOCdata: if (OR(rule!APN_isBlank(ri!programId),rule!APN_isBlank(ri!hrgeid)),
{},rule!CMP_getChartDataprogramLevel(
roleType: "HRG",
programId: ri!programId,
type: "REGION",
typeValue: "LA",
hrgeid: ri!hrgeid,
pagingInfo: ri!paginginfo
).data),

/*HRG Variables END*/


{
/*super admin*/
a!cardLayout(
showWhen: ri!dcSelectedRole = "CMP Super Admin",
contents: {
/*Super admin POC Chart starts*/
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Ethnicity"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"POC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminPOCdata),0,*/
/*if(rule!APN_isBlank(local!superadminPOCdata.nomineeemployeecount),0,*/
/*local!superadminPOCdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminPOCdata),0,*/
/*if(rule!APN_isBlank(local!superadminPOCdata.eligibleemployeecount),0,*/
/*local!superadminPOCdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminPOCdata),0,
if(tointeger(local!superadminPOCdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminPOCdata),0,tointeger(local!superadminPOCdata.nomineeemployeecount))
/tointeger(local!superadminPOCdata.eligibleemployeecount))*100))
),
/*Super admin POC Chart ends*/

/*Super admin NonPOC Chart starts*/

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"NON-POC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminNonPOCdata),0,*/
/*if(rule!APN_isBlank(local!superadminNonPOCdata.nomineeemployeecount),0,*/
/*local!superadminNonPOCdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminNonPOCdata),0,*/
/*if(rule!APN_isBlank(local!superadminNonPOCdata.eligibleemployeecount),0,*/
/*local!superadminNonPOCdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminNonPOCdata),0,
if(tointeger(local!superadminNonPOCdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminNonPOCdata),0,tointeger(local!superadminNonPOCdata.nomineeemployeecount))
/tointeger(local!superadminNonPOCdata.eligibleemployeecount))*100))
),

/*Super admin NonPOC Chart ends*/
/*Super admin Gender Female Chart Starts*/

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Gender"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Female"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminGenderFdata),0,*/
/*if(rule!APN_isBlank(local!superadminGenderFdata.nomineeemployeecount),0,*/
/*local!superadminGenderFdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminGenderFdata),0,*/
/*if(rule!APN_isBlank(local!superadminGenderFdata.eligibleemployeecount),0,*/
/*local!superadminGenderFdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminGenderFdata),0,
if(tointeger(local!superadminGenderFdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminGenderFdata),0,tointeger(local!superadminGenderFdata.nomineeemployeecount))
/tointeger(local!superadminGenderFdata.eligibleemployeecount))*100))
),

/*Super admin Gender Female Chart ends*/
/*Super admin Gender Male Chart Starts*/
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Male"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminGenderMdata),0,*/
/*if(rule!APN_isBlank(local!superadminGenderMdata.nomineeemployeecount),0,*/
/*local!superadminGenderMdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminGenderMdata),0,*/
/*if(rule!APN_isBlank(local!superadminGenderMdata.eligibleemployeecount),0,*/
/*local!superadminGenderMdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminGenderMdata),0,
if(tointeger(local!superadminGenderMdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminGenderMdata),0,tointeger(local!superadminGenderMdata.nomineeemployeecount))
/tointeger(local!superadminGenderMdata.eligibleemployeecount))*100))
),

/*Super admin Gender male Chart ends*/

/*Super admin Region Chart starts*/

/* APAC starts */

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Region"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"APAC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminRegionAPACdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionAPACdata.nomineeemployeecount),0,*/
/*local!superadminRegionAPACdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminRegionAPACdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionAPACdata.eligibleemployeecount),0,*/
/*local!superadminRegionAPACdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminRegionAPACdata),0,
if(tointeger(local!superadminRegionAPACdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminRegionAPACdata),0,tointeger(local!superadminRegionAPACdata.nomineeemployeecount))
/tointeger(local!superadminRegionAPACdata.eligibleemployeecount))*100))
),
/* APAC ends */

/* LATAM Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"LATAM"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminRegionLATAMdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionLATAMdata.nomineeemployeecount),0,*/
/*local!superadminRegionLATAMdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminRegionLATAMdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionLATAMdata.eligibleemployeecount),0,*/
/*local!superadminRegionLATAMdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminRegionLATAMdata),0,
if(tointeger(local!superadminRegionLATAMdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminRegionLATAMdata),0,tointeger(local!superadminRegionLATAMdata.nomineeemployeecount))
/tointeger(local!superadminRegionLATAMdata.eligibleemployeecount))*100))
),

/* LATAM ENDS */
/* CAN starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"CAN"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminRegionCANdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionCANdata.nomineeemployeecount),0,*/
/*local!superadminRegionCANdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminRegionCANdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionCANdata.eligibleemployeecount),0,*/
/*local!superadminRegionCANdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminRegionCANdata),0,
if(tointeger(local!superadminRegionCANdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminRegionCANdata),0,tointeger(local!superadminRegionCANdata.nomineeemployeecount))
/tointeger(local!superadminRegionCANdata.eligibleemployeecount))*100))
),

/* CAN Ends */

/* EMEA Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"EMEA"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminRegionEMEAdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionEMEAdata.nomineeemployeecount),0,*/
/*local!superadminRegionEMEAdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminRegionEMEAdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionEMEAdata.eligibleemployeecount),0,*/
/*local!superadminRegionEMEAdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminRegionEMEAdata),0,
if(tointeger(local!superadminRegionEMEAdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminRegionEMEAdata),0,tointeger(local!superadminRegionEMEAdata.nomineeemployeecount))
/tointeger(local!superadminRegionEMEAdata.eligibleemployeecount))*100))
),

/* EMEA Ends */
/* US Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"US"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!superadminRegionUSdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionUSdata.nomineeemployeecount),0,*/
/*local!superadminRegionUSdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!superadminRegionUSdata),0,*/
/*if(rule!APN_isBlank(local!superadminRegionUSdata.eligibleemployeecount),0,*/
/*local!superadminRegionUSdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!superadminRegionUSdata),0,
if(tointeger(local!superadminRegionUSdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!superadminRegionUSdata),0,tointeger(local!superadminRegionUSdata.nomineeemployeecount))
/tointeger(local!superadminRegionUSdata.eligibleemployeecount))*100))
),

/* US Ends */

/*Super admin Region Chart ends*/

}

),

/*Nominator*/
a!cardLayout(
showWhen: ri!dcSelectedRole = "CMP Nominators",
contents: {
/*Nominator POC Chart starts*/
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Ethnicity"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"POC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomPOCdata),0,*/
/*if(rule!APN_isBlank(local!nomPOCdata.nomineeemployeecount),0,*/
/*local!nomPOCdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomPOCdata),0,*/
/*if(rule!APN_isBlank(local!nomPOCdata.eligibleemployeecount),0,*/
/*local!nomPOCdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomPOCdata),0,
if(tointeger(local!nomPOCdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomPOCdata),0,tointeger(local!nomPOCdata.nomineeemployeecount))
/tointeger(local!nomPOCdata.eligibleemployeecount))*100))
),
/*NominatorPOC Chart ends*/

/*Nominator NonPOC Chart starts*/

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"NON-POC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomNonPOCdata),0,*/
/*if(rule!APN_isBlank(local!nomNonPOCdata.nomineeemployeecount),0,*/
/*local!nomNonPOCdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomNonPOCdata),0,*/
/*if(rule!APN_isBlank(local!nomNonPOCdata.eligibleemployeecount),0,*/
/*local!nomNonPOCdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomNonPOCdata),0,
if(tointeger(local!nomNonPOCdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomNonPOCdata),0,tointeger(local!nomNonPOCdata.nomineeemployeecount))
/tointeger(local!nomNonPOCdata.eligibleemployeecount))*100))
),

/*Nominator NonPOC Chart ends*/
/*NominatorGender Female Chart Starts*/

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Gender"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Female"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomGenderFdata),0,*/
/*if(rule!APN_isBlank(local!nomGenderFdata.nomineeemployeecount),0,*/
/*local!nomGenderFdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomGenderFdata),0,*/
/*if(rule!APN_isBlank(local!nomGenderFdata.eligibleemployeecount),0,*/
/*local!nomGenderFdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomGenderFdata),0,
if(tointeger(local!nomGenderFdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomGenderFdata),0,tointeger(local!nomGenderFdata.nomineeemployeecount))
/tointeger(local!nomGenderFdata.eligibleemployeecount))*100))
),

/*Nominator Gender Female Chart ends*/
/*Nominator Gender Male Chart Starts*/
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Male"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomGenderMdata),0,*/
/*if(rule!APN_isBlank(local!nomGenderMdata.nomineeemployeecount),0,*/
/*local!nomGenderMdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomGenderMdata),0,*/
/*if(rule!APN_isBlank(local!nomGenderMdata.eligibleemployeecount),0,*/
/*local!nomGenderMdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomGenderMdata),0,
if(tointeger(local!nomGenderMdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomGenderMdata),0,tointeger(local!nomGenderMdata.nomineeemployeecount))
/tointeger(local!nomGenderMdata.eligibleemployeecount))*100))
),

/*Nominator Gender male Chart ends*/

/*Nominator Region Chart starts*/

/* APAC starts */

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Region"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"APAC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomRegionAPACdata),0,*/
/*if(rule!APN_isBlank(local!nomRegionAPACdata.nomineeemployeecount),0,*/
/*local!nomRegionAPACdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomRegionAPACdata),0,*/
/*if(rule!APN_isBlank(local!nomRegionAPACdata.eligibleemployeecount),0,*/
/*local!nomRegionAPACdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomRegionAPACdata),0,
if(tointeger(local!nomRegionAPACdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomRegionAPACdata),0,tointeger(local!nomRegionAPACdata.nomineeemployeecount))
/tointeger(local!nomRegionAPACdata.eligibleemployeecount))*100))
),
/* APAC ends */

/* LATAM Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"LATAM"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomLATAMdata),0,*/
/*if(rule!APN_isBlank(local!nomLATAMdata.nomineeemployeecount),0,*/
/*local!nomLATAMdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomLATAMdata),0,*/
/*if(rule!APN_isBlank(local!nomLATAMdata.eligibleemployeecount),0,*/
/*local!nomLATAMdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomLATAMdata),0,
if(tointeger(local!nomLATAMdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomLATAMdata),0,tointeger(local!nomLATAMdata.nomineeemployeecount))
/tointeger(local!nomLATAMdata.eligibleemployeecount))*100))
),

/* LATAM ENDS */
/* CAN starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"CAN"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomCANdata),0,*/
/*if(rule!APN_isBlank(local!nomCANdata.nomineeemployeecount),0,*/
/*local!nomCANdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomCANdata),0,*/
/*if(rule!APN_isBlank(local!nomCANdata.eligibleemployeecount),0,*/
/*local!nomCANdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomCANdata),0,
if(tointeger(local!nomCANdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomCANdata),0,tointeger(local!nomCANdata.nomineeemployeecount))
/tointeger(local!nomCANdata.eligibleemployeecount))*100))
),

/* CAN Ends */

/* EMEA Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"EMEA"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomRegionEMEAdata),0,*/
/*if(rule!APN_isBlank(local!nomRegionEMEAdata.nomineeemployeecount),0,*/
/*local!nomRegionEMEAdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomRegionEMEAdata),0,*/
/*if(rule!APN_isBlank(local!nomRegionEMEAdata.eligibleemployeecount),0,*/
/*local!nomRegionEMEAdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomRegionEMEAdata),0,
if(tointeger(local!nomRegionEMEAdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomRegionEMEAdata),0,tointeger(local!nomRegionEMEAdata.nomineeemployeecount))
/tointeger(local!nomRegionEMEAdata.eligibleemployeecount))*100))
),

/* EMEA Ends */
/* US Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"US"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!nomRegionUSdata),0,*/
/*if(rule!APN_isBlank(local!nomRegionUSdata.nomineeemployeecount),0,*/
/*local!nomRegionUSdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!nomRegionUSdata),0,*/
/*if(rule!APN_isBlank(local!nomRegionUSdata.eligibleemployeecount),0,*/
/*local!nomRegionUSdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!nomRegionUSdata),0,
if(tointeger(local!nomRegionUSdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!nomRegionUSdata),0,tointeger(local!nomRegionUSdata.nomineeemployeecount))
/tointeger(local!nomRegionUSdata.eligibleemployeecount))*100))
),

/* US Ends */

/*Nominator Region Chart ends*/

}
),

/*HRG*/
a!cardLayout(
showWhen: ri!dcSelectedRole = "CMP Nominators HRG",
contents: {

/*HRG POC Chart starts*/
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Ethnicity"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"POC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgPOCdata),0,*/
/*if(rule!APN_isBlank(local!hrgPOCdata.nomineeemployeecount),0,*/
/*local!hrgPOCdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgPOCdata),0,*/
/*if(rule!APN_isBlank(local!hrgPOCdata.eligibleemployeecount),0,*/
/*local!hrgPOCdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgPOCdata),0,
if(tointeger(local!hrgPOCdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgPOCdata),0,tointeger(local!hrgPOCdata.nomineeemployeecount))
/tointeger(local!hrgPOCdata.eligibleemployeecount))*100))
),
/*HRG POC Chart ends*/

/*HRG NonPOC Chart starts*/

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"NON-POC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgNonPOCdata),0,*/
/*if(rule!APN_isBlank(local!hrgNonPOCdata.nomineeemployeecount),0,*/
/*local!hrgNonPOCdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgNonPOCdata),0,*/
/*if(rule!APN_isBlank(local!hrgNonPOCdata.eligibleemployeecount),0,*/
/*local!hrgNonPOCdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgNonPOCdata),0,
if(tointeger(local!hrgNonPOCdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgNonPOCdata),0,tointeger(local!hrgNonPOCdata.nomineeemployeecount))
/tointeger(local!hrgNonPOCdata.eligibleemployeecount))*100))
),

/*hrg NonPOC Chart ends*/
/*hrg Gender Female Chart Starts*/

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Gender"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Female"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgGenderFdata),0,*/
/*if(rule!APN_isBlank(local!hrgGenderFdata.nomineeemployeecount),0,*/
/*local!hrgGenderFdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgGenderFdata),0,*/
/*if(rule!APN_isBlank(local!hrgGenderFdata.eligibleemployeecount),0,*/
/*local!hrgGenderFdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgGenderFdata),0,
if(tointeger(local!hrgGenderFdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgGenderFdata),0,tointeger(local!hrgGenderFdata.nomineeemployeecount))
/tointeger(local!hrgGenderFdata.eligibleemployeecount))*100))
),

/*hrg Gender Female Chart ends*/
/*hrg Gender Male Chart Starts*/
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Male"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgGenderMdata),0,*/
/*if(rule!APN_isBlank(local!hrgGenderMdata.nomineeemployeecount),0,*/
/*local!hrgGenderMdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgGenderMdata),0,*/
/*if(rule!APN_isBlank(local!hrgGenderMdata.eligibleemployeecount),0,*/
/*local!hrgGenderMdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgGenderMdata),0,
if(tointeger(local!hrgGenderMdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgGenderMdata),0,tointeger(local!hrgGenderMdata.nomineeemployeecount))
/tointeger(local!hrgGenderMdata.eligibleemployeecount))*100))
),

/*hrg Gender male Chart ends*/

/*hrg Region Chart starts*/

/* APAC starts */

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Region"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"APAC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgRegionAPACdata),0,*/
/*if(rule!APN_isBlank(local!hrgRegionAPACdata.nomineeemployeecount),0,*/
/*local!hrgRegionAPACdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgRegionAPACdata),0,*/
/*if(rule!APN_isBlank(local!hrgRegionAPACdata.eligibleemployeecount),0,*/
/*local!hrgRegionAPACdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgRegionAPACdata),0,
if(tointeger(local!hrgRegionAPACdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgRegionAPACdata),0,tointeger(local!hrgRegionAPACdata.nomineeemployeecount))
/tointeger(local!hrgRegionAPACdata.eligibleemployeecount))*100))
),
/* APAC ends */

/* LATAM Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"LATAM"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgLATAMdata),0,*/
/*if(rule!APN_isBlank(local!hrgLATAMdata.nomineeemployeecount),0,*/
/*local!hrgLATAMdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgLATAMdata),0,*/
/*if(rule!APN_isBlank(local!hrgLATAMdata.eligibleemployeecount),0,*/
/*local!hrgLATAMdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgLATAMdata),0,
if(tointeger(local!hrgLATAMdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgLATAMdata),0,tointeger(local!hrgLATAMdata.nomineeemployeecount))
/tointeger(local!hrgLATAMdata.eligibleemployeecount))*100))
),

/* LATAM ENDS */
/* CAN starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"CAN"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgCANdata),0,*/
/*if(rule!APN_isBlank(local!hrgCANdata.nomineeemployeecount),0,*/
/*local!hrgCANdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgCANdata),0,*/
/*if(rule!APN_isBlank(local!hrgCANdata.eligibleemployeecount),0,*/
/*local!hrgCANdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgCANdata),0,
if(tointeger(local!hrgCANdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgCANdata),0,tointeger(local!hrgCANdata.nomineeemployeecount))
/tointeger(local!hrgCANdata.eligibleemployeecount))*100))
),

/* CAN Ends */

/* EMEA Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"EMEA"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgRegionEMEAdata),0,*/
/*if(rule!APN_isBlank(local!hrgRegionEMEAdata.nomineeemployeecount),0,*/
/*local!hrgRegionEMEAdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgRegionEMEAdata),0,*/
/*if(rule!APN_isBlank(local!hrgRegionEMEAdata.eligibleemployeecount),0,*/
/*local!hrgRegionEMEAdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgRegionEMEAdata),0,
if(tointeger(local!hrgRegionEMEAdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgRegionEMEAdata),0,tointeger(local!hrgRegionEMEAdata.nomineeemployeecount))
/tointeger(local!hrgRegionEMEAdata.eligibleemployeecount))*100))
),

/* EMEA Ends */
/* US Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"US"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!hrgRegionUSdata),0,*/
/*if(rule!APN_isBlank(local!hrgRegionUSdata.nomineeemployeecount),0,*/
/*local!hrgRegionUSdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!hrgRegionUSdata),0,*/
/*if(rule!APN_isBlank(local!hrgRegionUSdata.eligibleemployeecount),0,*/
/*local!hrgRegionUSdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!hrgRegionUSdata),0,
if(tointeger(local!hrgRegionUSdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!hrgRegionUSdata),0,tointeger(local!hrgRegionUSdata.nomineeemployeecount))
/tointeger(local!hrgRegionUSdata.eligibleemployeecount))*100))
),

/* US Ends */

/*hrg Region Chart ends*/


}

),

/* HRVP/CL */
a!cardLayout(
showWhen: OR(
contains(getgroupnames(cons!CMP_GRP_ALL_SBG_CLs),local!dcselectedrole),
contains(getgroupnames(cons!CMP_GRP_ALL_SBG_HR_VPs), local!dcSelectedRole)
),
contents: {
/*HRVP/CL POC Chart starts*/
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Ethnicity"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"POC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgPOCdata),0,*/
/*if(rule!APN_isBlank(local!sbgPOCdata.nomineeemployeecount),0,*/
/*local!sbgPOCdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgPOCdata),0,*/
/*if(rule!APN_isBlank(local!sbgPOCdata.eligibleemployeecount),0,*/
/*local!sbgPOCdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgPOCdata),0,
if(tointeger(local!sbgPOCdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgPOCdata),0,tointeger(local!sbgPOCdata.nomineeemployeecount))
/tointeger(local!sbgPOCdata.eligibleemployeecount))*100))
),
/*HRVP/CL POC Chart ends*/

/*HRVP/CL NonPOC Chart starts*/

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"NON-POC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgNonPOCdata),0,*/
/*if(rule!APN_isBlank(local!sbgNonPOCdata.nomineeemployeecount),0,*/
/*local!sbgNonPOCdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgNonPOCdata),0,*/
/*if(rule!APN_isBlank(local!sbgNonPOCdata.eligibleemployeecount),0,*/
/*local!sbgNonPOCdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgNonPOCdata),0,
if(tointeger(local!sbgNonPOCdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgNonPOCdata),0,tointeger(local!sbgNonPOCdata.nomineeemployeecount))
/tointeger(local!sbgNonPOCdata.eligibleemployeecount))*100))
),

/*HRVP/CL NonPOC Chart ends*/
/*HRVP/CL Gender Female Chart Starts*/

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Gender"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Female"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgGenderFdata),0,*/
/*if(rule!APN_isBlank(local!sbgGenderFdata.nomineeemployeecount),0,*/
/*local!sbgGenderFdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgGenderFdata),0,*/
/*if(rule!APN_isBlank(local!sbgGenderFdata.eligibleemployeecount),0,*/
/*local!sbgGenderFdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgGenderFdata),0,
if(tointeger(local!sbgGenderFdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgGenderFdata),0,tointeger(local!sbgGenderFdata.nomineeemployeecount))
/tointeger(local!sbgGenderFdata.eligibleemployeecount))*100))
),

/*sbg Gender Female Chart ends*/
/*sbg Gender Male Chart Starts*/
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Male"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgGenderMdata),0,*/
/*if(rule!APN_isBlank(local!sbgGenderMdata.nomineeemployeecount),0,*/
/*local!sbgGenderMdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgGenderMdata),0,*/
/*if(rule!APN_isBlank(local!sbgGenderMdata.eligibleemployeecount),0,*/
/*local!sbgGenderMdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgGenderMdata),0,
if(tointeger(local!sbgGenderMdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgGenderMdata),0,tointeger(local!sbgGenderMdata.nomineeemployeecount))
/tointeger(local!sbgGenderMdata.eligibleemployeecount))*100))
),

/*HRVP/CL Gender male Chart ends*/

/*HRVP/CL Region Chart starts*/

/* APAC starts */

a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"Region"
},
size: "STANDARD",
style: {
"STRONG"
}
)
},
align: "LEFT"
),
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"APAC"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgRegionAPACdata),0,*/
/*if(rule!APN_isBlank(local!sbgRegionAPACdata.nomineeemployeecount),0,*/
/*local!sbgRegionAPACdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgRegionAPACdata),0,*/
/*if(rule!APN_isBlank(local!sbgRegionAPACdata.eligibleemployeecount),0,*/
/*local!sbgRegionAPACdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgRegionAPACdata),0,
if(tointeger(local!sbgRegionAPACdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgRegionAPACdata),0,tointeger(local!sbgRegionAPACdata.nomineeemployeecount))
/tointeger(local!sbgRegionAPACdata.eligibleemployeecount))*100))
),
/* APAC ends */

/* LATAM Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"LATAM"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgLATAMdata),0,*/
/*if(rule!APN_isBlank(local!sbgLATAMdata.nomineeemployeecount),0,*/
/*local!sbgLATAMdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgLATAMdata),0,*/
/*if(rule!APN_isBlank(local!sbgLATAMdata.eligibleemployeecount),0,*/
/*local!sbgLATAMdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgLATAMdata),0,
if(tointeger(local!sbgLATAMdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgLATAMdata),0,tointeger(local!sbgLATAMdata.nomineeemployeecount))
/tointeger(local!sbgLATAMdata.eligibleemployeecount))*100))
),

/* LATAM ENDS */
/* CAN starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"CAN"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgCANdata),0,*/
/*if(rule!APN_isBlank(local!sbgCANdata.nomineeemployeecount),0,*/
/*local!sbgCANdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgCANdata),0,*/
/*if(rule!APN_isBlank(local!sbgCANdata.eligibleemployeecount),0,*/
/*local!sbgCANdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgCANdata),0,
if(tointeger(local!sbgCANdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgCANdata),0,tointeger(local!sbgCANdata.nomineeemployeecount))
/tointeger(local!sbgCANdata.eligibleemployeecount))*100))
),

/* CAN Ends */

/* EMEA Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"EMEA"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgRegionEMEAdata),0,*/
/*if(rule!APN_isBlank(local!sbgRegionEMEAdata.nomineeemployeecount),0,*/
/*local!sbgRegionEMEAdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgRegionEMEAdata),0,*/
/*if(rule!APN_isBlank(local!sbgRegionEMEAdata.eligibleemployeecount),0,*/
/*local!sbgRegionEMEAdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgRegionEMEAdata),0,
if(tointeger(local!sbgRegionEMEAdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgRegionEMEAdata),0,tointeger(local!sbgRegionEMEAdata.nomineeemployeecount))
/tointeger(local!sbgRegionEMEAdata.eligibleemployeecount))*100))
),

/* EMEA Ends */
/* US Starts */
a!richTextDisplayField(
labelposition: "COLLAPSED",
value: {
a!richTextItem(
text: {
"US"
},
size: "STANDARD",

)
},
align: "LEFT"
),
/*a!richTextDisplayField(*/
/**/
/*labelposition: "COLLAPSED",*/
/*value: {*/
/*a!richTextItem(*/
/*text: {*/
/*if(rule!APN_isBlank(local!sbgRegionUSdata),0,*/
/*if(rule!APN_isBlank(local!sbgRegionUSdata.nomineeemployeecount),0,*/
/*local!sbgRegionUSdata.nomineeemployeecount))*/
/*& " Nominee out of " & */
/*if(rule!APN_isBlank(local!sbgRegionUSdata),0,*/
/*if(rule!APN_isBlank(local!sbgRegionUSdata.eligibleemployeecount),0,*/
/*local!sbgRegionUSdata.eligibleemployeecount)) & " Minimum"*/
/*},*/
/*size: "SMALL"*/
/*)*/
/*},*/
/*align: "LEFT"*/
/*),*/
a!progressBarField(
label: "",
labelPosition: "COLLAPSED",
percentage: if(rule!APN_isBlank(local!sbgRegionUSdata),0,
if(tointeger(local!sbgRegionUSdata.eligibleemployeecount)=0,0,
(if(rule!APN_isBlank(local!sbgRegionUSdata),0,tointeger(local!sbgRegionUSdata.nomineeemployeecount))
/tointeger(local!sbgRegionUSdata.eligibleemployeecount))*100))
),

/* US Ends */

/*HRVP/CL Region Chart ends*/

}
)







}


)

)

Warm Regards

Vineeth

  Discussion posts and replies are publicly visible

Parents
  • Hi Vineeth

    Firstly, for future reference please use the 'Insert Code' option (under the ;Insert' menu) to add code to these discussions, it retains the formatting and makes it easier for others to review, and copy (if we want to load your code into our own Interface Designer)

    A few observations:

    • this code is way too large and complex. All except one of the 37 local!  variables defined are conditional i.e. they have an if() statement around them. Since the if() is handling whether the values of relevant parameters are blank can you not implement this logic inside the rule!CMP_getChartDataprogramLevel() ?
    • the a!progressBarField() implementation logic looks to me to be the same but with different data - this would benefit from being refactored/abstracted into its own rule
    • the same can be apllied to the a!richTextDisplayField() - this is also the same each time, but with different data so could become its own parameterised rule HINT: if you find yourself copying/pasting code fragments inside an Interface or Expression Rule and changing values without changing the structure/implementation then that indicates it should be extracted into its own component
    • I presume the Query Entity is embedded in the rule!CMP_getChartDataprogramLevel() which you are calling 36 times. You may find it better to call this rule once for every combination of the rule inputs across your 36 calls, and then extract the relevant data from the one local! variable. If that's too complicated you could find common groupings of the data and reduce the calls to a smaller number e.g. 

    rule!CMP_getChartDataprogramLevel(
            roleType: "SuperAdmin",
            programId: ri!programId,
            type: "POC",
            typeValue: {"1", "2"}
          ).data

    ...and then you can separate the two tranches of data from one local! variable and save yourself a call to the database. 

    • I also notice you're wrapping the entire implementation in  a with(). This means ALL of your local! variables will be reloaded, even if they don't need to be e.g. if the value of ri!sbg changes, only those local! variables that are loaded from calls to rule!CMP_getChartDataprogramLevel() that use ri!sbg should be re-loaded. The others can retain the data they've already been loaded with. You can use the a!refreshVariable() to control what gets re-loaded under which changes in ri! values
Reply
  • Hi Vineeth

    Firstly, for future reference please use the 'Insert Code' option (under the ;Insert' menu) to add code to these discussions, it retains the formatting and makes it easier for others to review, and copy (if we want to load your code into our own Interface Designer)

    A few observations:

    • this code is way too large and complex. All except one of the 37 local!  variables defined are conditional i.e. they have an if() statement around them. Since the if() is handling whether the values of relevant parameters are blank can you not implement this logic inside the rule!CMP_getChartDataprogramLevel() ?
    • the a!progressBarField() implementation logic looks to me to be the same but with different data - this would benefit from being refactored/abstracted into its own rule
    • the same can be apllied to the a!richTextDisplayField() - this is also the same each time, but with different data so could become its own parameterised rule HINT: if you find yourself copying/pasting code fragments inside an Interface or Expression Rule and changing values without changing the structure/implementation then that indicates it should be extracted into its own component
    • I presume the Query Entity is embedded in the rule!CMP_getChartDataprogramLevel() which you are calling 36 times. You may find it better to call this rule once for every combination of the rule inputs across your 36 calls, and then extract the relevant data from the one local! variable. If that's too complicated you could find common groupings of the data and reduce the calls to a smaller number e.g. 

    rule!CMP_getChartDataprogramLevel(
            roleType: "SuperAdmin",
            programId: ri!programId,
            type: "POC",
            typeValue: {"1", "2"}
          ).data

    ...and then you can separate the two tranches of data from one local! variable and save yourself a call to the database. 

    • I also notice you're wrapping the entire implementation in  a with(). This means ALL of your local! variables will be reloaded, even if they don't need to be e.g. if the value of ri!sbg changes, only those local! variables that are loaded from calls to rule!CMP_getChartDataprogramLevel() that use ri!sbg should be re-loaded. The others can retain the data they've already been loaded with. You can use the a!refreshVariable() to control what gets re-loaded under which changes in ri! values
Children
  • Hi Stewart, thanks for the reply, Sorry the Insert code was not working , so have put the code in the body,

    using the code example above, am getting the output as List of Variants - 0

    but both typevalue 1 and 2 has values, but if I put it together, it gives 0

  • Your Query Entity needs to be altered to allow the queryFilter to use a list of values for 'typeValue'. 

  • If you send me the code for rule!CMP_getChartDataprogramLevel() I can show you what I mean

  • if(ri!roleType = "SuperAdmin",
        a!queryEntity(
          entity: cons!CMP_CHART_PROGRAM_CONS,
          query: a!query(
            logicalExpression: a!queryLogicalExpression(
              operator: "AND",
              filters: {
                a!queryFilter(
                  field: "programid",
                  operator: "=",
                  value: ri!programID
                ),
                a!queryFilter(
                  field: "type",
                  operator: "=",
                  value: ri!type
                ),
                a!queryFilter(
                  field: "typevalue",
                  operator: "=",
                  value: ri!typeValue
                ),
              }
            ),
            pagingInfo: a!pagingInfo(startIndex: 1,batchSize: -1)
          ),
          fetchTotalCount: true
        ).data,
        if(ri!roleType = "CL",
            a!queryEntity(
              entity: cons!CMP_CHART_SBG_CONS,
              query: a!query(
                logicalExpression: a!queryLogicalExpression(
                  operator: "AND",
                  filters: {
                    a!queryFilter(
                      field: "programid",
                      operator: "=",
                      value: ri!programID
                    ),
                    a!queryFilter(
                      field: "type",
                      operator: "=",
                      value: ri!type
                    ),
                    a!queryFilter(
                      field: "typevalue",
                      operator: "=",
                      value: ri!typeValue
                    ),
                    a!queryFilter(
                      field: "sbg",
                      operator: "=",
                      value: ri!sbg
                    ),
        
        
                  }
                ),
                pagingInfo:  a!pagingInfo(startIndex: 1,batchSize: -1)
              ),
              fetchTotalCount: true
            ),
            if(ri!roleType = "NOM",
                  a!queryEntity(
                    entity: cons!CMP_CHART_NOMINATOR_CONS,
                    query: a!query(
                      logicalExpression: a!queryLogicalExpression(
                        operator: "AND",
                        filters: {
                          a!queryFilter(
                            field: "programid",
                            operator: "=",
                            value: ri!programID
                          ),
                          a!queryFilter(
                            field: "type",
                            operator: "=",
                            value: ri!type
                          ),
                          a!queryFilter(
                            field: "typevalue",
                            operator: "=",
                            value: ri!typeValue
                          ),
                          a!queryFilter(
                            field: "nominatoreid",
                            operator: "=",
                            value: ri!nominatorEID
                          ),
          
          
                        }
                      ),
                      pagingInfo: a!pagingInfo(startIndex: 1,batchSize: -1)
                    ),
                    fetchTotalCount: true
                  ),
                  if(ri!roleType = "HRG",
                        a!queryEntity(
                          entity: cons!CMP_CHART_HRG_CONS,
                          query: a!query(
                            logicalExpression: a!queryLogicalExpression(
                              operator: "AND",
                              filters: {
                                a!queryFilter(
                                  field: "programid",
                                  operator: "=",
                                  value: ri!programID
                                ),
                                a!queryFilter(
                                  field: "type",
                                  operator: "=",
                                  value: ri!type
                                ),
                                a!queryFilter(
                                  field: "typevalue",
                                  operator: "=",
                                  value: ri!typeValue
                                ),
                                a!queryFilter(
                                  field: "hrgeid",
                                  operator: "=",
                                  value: ri!hrgeid
                                ),
          
          
                              }
                            ),
                            pagingInfo: a!pagingInfo(startIndex: 1,batchSize: -1)
                          ),
                          fetchTotalCount: true
                        ),  
                        null
                  )
            )
        )
    )

    I have attached the code , thank you

  • You can use the "in" operator rather than the "=" operator for the queryFilter on the field "typevalue". You'll have to make sure that ri!typeValue is an array so you can pass in multiple values.

    Again, an observation: you are essentially constructing the same Query Entity based upon different if() conditions. You could make a single Query Entity, use the incoming value of ri!roleType to select the relevant entity cons!, and then use the 'applyWhen' in the filters that only apply conditionally. This will make the code more maintainable and easier to read.