cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Get cell count (or row / column count) of a Crosstab in Lumira Designer

Ivan_Camac
Participant
0 Kudos
837

Hi,

I am trying to implement a solution for our users where a Lumira app will contain two different cross tabs, one with pixel based scrolling enabled and one without. Then depending on the state of the datasource (data volume) I want to dynamically switch between the two different cross tabs in the UI. This is for a Generic Analysis style app where I will not know exactly which query a user is running, or the navigation state they have for the query.

If they are displaying a datasource in a navigational state where the record volume is low then I want them to be able to use the pixel based scrolling cross tab as this provides a far better user experience when scrolling (our users are coming from BEx Web Analyser and so the HATE the scrolling performance of the Lumira Crosstab). If they are accessing a large query though, they will have to revert to the standard Crosstab and the page based scrolling.

So far I have tried using the following code in a datasource on results changed event:

// Get all dimensions across the rows
var rowDims = DS_1.getDimensions(Axis.ROWS);

// Create empty selection JSON
var sel = Convert.stringToDataSelection(); 

// Loop through dimensions and add to the selection JSON
rowDims.forEach(function(dimension, index) {
	sel[dimension.name] = ["*"];
});

// Return selection array based on above selection
var dataArray = DS_1.getDataSelections(sel);

// Return the number of rows in the Crosstab (including results rows)
APPLICATION.log("Total rows: " + dataArray.length);

The issue with the above is that it hits a "Too Much Data" error which I can't seem to catch once the row count is too high when trying to perform DS_1.getDataSelections(sel); and at that point it returns zero.

Secondly, although this approach does give an accurate row count (with success well up into the thousands), I was hoping there might be a better way to just get the cell count from a datasource.

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Product and Topic Expert
Product and Topic Expert
0 Kudos

Very cool approach - unfortunately I have no better idea 😞 .