Show/hide table tab on switch button toggle:
//on switch button
if (SWH_TogglePCodes.isOn()){
TABS_IS.setSelectedKey("With_Exclusion");
Application.showMessage(ApplicationMessageType.Info,"IPR is excluded");
} else {
TABS_IS.setSelectedKey("Without_Exclusion");
Application.showMessage(ApplicationMessageType.Info,"IPR is included");
}
Filter to Exclude Product codes 1:
//apply on switch button
}
Filter to Exclude Product codes 2:
//apply on switch button
// write below code on switch to call method:
Methods.FilterPCodes([Table_48, Table_30, Table_49, Table_50],"CFIREPCOD",Switch_1.isOn());
// create a method & write below code in it to filter in/filter out:
var ExcludePCodes = ArrayUtils.create(Type.string);
//Current set of p-codes needed to exclude/include - 5000,5001,72,72A,72CL,72I,72NW
ExcludePCodes = ["5000","5001","72","72A","72CL","72NW","72I"];
/*
var counter = 0;
var bool = 0;
if(gNewPCodes.length<1){
for (var l=0; l<gPCodes.length;l++){
bool = 0;
for (var k=0; k<ExcludePCodes.length; k++){
if ( (ExcludePCodes[k] !== gPCodes[l]) ){
bool = bool+1;
}
}
if (bool === ExcludePCodes.length){
gNewPCodes[counter] = gPCodes[l];
counter++; }
}
}
console.log(gNewPCodes);
*/
var len = TableNames.length;
if (OnOrOff){
//console.log("true");
for(var i=0;i<len;i++){
TableNames[i].getDataSource().setHierarchy(DimensionName,'__FLAT__');
TableNames[i].getDataSource().setDimensionFilter(DimensionName,{values: ExcludePCodes, exclude: true});
}
Application.showMessage(ApplicationMessageType.Info,"This might take some time as P-Codes: \"5000,5001,72,72A,72CL,72NW\" are being excluded from the data.");
} else {
//console.log("false");
for(var j=0;j<len;j++){
TableNames[j].getDataSource().removeDimensionFilter(DimensionName);
}
Application.showMessage(ApplicationMessageType.Info,"All P-Codes are now included in the data.");
}
0 टिप्पणियाँ
Please do not enter any spam link in the comment box.