In first part of the blog I explained how Basic Analysis Layout Template can be enhanced with Lumira Style Lasso using out the box capabilities. Now I will go over BIAL scripts in details.

    lasso_store_selection

    This script is run on CHART On Select event to stored selection. In particular:



var selection = 0;

// count

DS_1.getDimensions(Axis.ROWS).forEach(function(element, index) {

      if(!element.isMeasuresDimension) {

            if(CHART.getSelectedMember(element.name).externalKey!=) {

                  CHART.getSelectedMembers(element.name).forEach(function(element1, index) {

                        selection = selection + 1;               

                  } );

            }

      }

} );

DS_1.getDimensions(Axis.COLUMNS).forEach(function(element, index) {

      if(!element.isMeasuresDimension) {

            if(CHART.getSelectedMember(element.name).externalKey!=) {

                  CHART.getSelectedMembers(element.name).forEach(function(element1, index) {

                        selection = selection + 1;               

                  } );

            }

      }

} );

//count

// filter

var new_filter = ;

DS_1.getDimensions(Axis.ROWS).forEach(function(element, index) {

      if(CHART.getSelectedMember(element.name).externalKey!=) {

            if(!element.isMeasuresDimension) {

                  DS_2.clearFilter(element.name);

                  DS_2.setFilter(element.name, CHART.getSelectedMembers(element.name));

            }

      }

} );

DS_1.getDimensions(Axis.COLUMNS).forEach(function(element, index) {

      if(CHART.getSelectedMember(element.name).externalKey!=) {

            if(!element.isMeasuresDimension) {

                  DS_2.clearFilter(element.name);

                  DS_2.setFilter(element.name, CHART.getSelectedMembers(element.name));

            }

      }

} );

// filter

// exclude

var  filter_val = ;

DS_1.getDimensions(Axis.ROWS).forEach(function(element, index) {

      if(!element.isMeasuresDimension) {

            if(CHART.getSelectedMember(element.name).externalKey!=) {

                  filter_val = DS_1.getFilterExt(element.name); 

                  CHART.getSelectedMembers(element.name).forEach(function(element1, index) {

                      if (filter_val==) {

                        filter_val = ‘!’ + element1.externalKey;

                      }

                    else {     

                        filter_val = filter_val + ‘;!’ + element1.externalKey;

                    }

                  } );

                DS_3.setFilterExt(element.name, filter_val);           

                  }

            }

} );

DS_1.getDimensions(Axis.COLUMNS).forEach(function(element, index) {

      if(!element.isMeasuresDimension) {

            if(CHART.getSelectedMember(element.name).externalKey!=) {

                  filter_val = DS_1.getFilterExt(element.name);

                  CHART.getSelectedMembers(element.name).forEach(function(element1, index) {

                      if (filter_val==) {

                        filter_val = ‘!’ + element1.externalKey;

                      }

                    else {     

                        filter_val = filter_val + ‘;!’ + element1.externalKey;

                    }

                  } );

                DS_3.setFilterExt(element.name, filter_val);           

                  }

            }

} );

// exclude

// popup

CHART.clearSelection();

if (selection > 0) {

      POPUP_LASSO.show();   

}

// popup




    lasso_filter


    This script is run on Filter Icon / Text On Click event to filter DS_1 to include only CHART selection. In particular:


DS_1.getDimensions(Axis.ROWS).forEach(function(element, index) {

      if(!element.isMeasuresDimension) {

            DS_1.setFilterExt(element.name, DS_2.getFilterExt(element.name));

      }

});

DS_1.getDimensions(Axis.COLUMNS).forEach(function(element, index) {

      if(!element.isMeasuresDimension) {

            DS_1.setFilterExt(element.name, DS_2.getFilterExt(element.name));

      }

});

POPUP_LASSO.hide();



    lasso_exclude


    This script is run on Filter Icon / Text On Click event to filter DS_1 to exclude CHART selection. In particular:


DS_1.getDimensions(Axis.ROWS).forEach(function(element, index) {

      if (!element.isMeasuresDimension) {

            DS_1.setFilterExt(element.name, DS_3.getFilterExt(element.name));

      }

});

DS_1.getDimensions(Axis.COLUMNS).forEach(function(element, index) {

      if (!element.isMeasuresDimension) {

            DS_1.setFilterExt(element.name, DS_3.getFilterExt(element.name));

      }

});

POPUP_LASSO.hide();

  In third of the blog, I will focus on Undo Previous Step command issue with Lasso and how to resolve it.

  Attached is an exported model (unpack and change extension to zip prior to importing)

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply