Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
BenjaminGroff
Contributor III
Contributor III

Limit Straight Table Row Count

Hi all,

I am working on a new mashup where users build out a custom table based on their selections. I am grabbing a massive table full of show/hide expressions from my app (using getObject) to use as a preview mechanic for their selections. The issue is that some of the selection options include very large datasets which can make the preview run slow and sometimes time out.

I am looking for a way to limit the amount of rows on my straight table in order to make this preview table load faster. The the table is only for preview use so it is not important to show everything within it.

Some things I have tried are:

- Using a new extension. I am using a massive preexisting table and was not able to get it to convert all of the show/hide options over to a new extension when using "convert to". We will be replacing this table with the newest version often so it is important that it converts over easily.

- Using "limitation" option for dimensions. With the way we have the data loading this is not a viable option and it will bypass it.

- I have tried using enigma "applyPatches" to change the hypercubedef initialDataFetch. This went through but did not effect the results shown in the table.

- Finally I tried grabbing the hypercubedef from the existing table, modifying the initialDataFetch, and using the visualization API to create a new table to use. This modified the hypercube properly but when the table shows up it still includes all of the data.

BenjaminGroff_0-1696871334631.png

Any help on this topic would be greatly appreciated including anything I may have missed with my previous efforts. Thank you in advance!

Labels (3)
1 Solution

Accepted Solutions
alex_colombo
Employee
Employee

Hi @BenjaminGroff it is not clear to me why Dimension limit is not an option. Could you please describe this?
In anycase, you cannot change qInitialDataFetch from an existing chart. Here you can find a list of all properties from a table that you can change (setOptions Capability API method triggers ApplyPatches Engine API method behind the scenes).

I tried to apply a patch to the entire HyperCubeDef changing the limitation of the first dimension to 10 values. This works fine, below the code

app.visualization.get('mGVGsT').then(function(viz) {
	//Change qDimension qOtherTotalSpec for limiting dimension values
	const vizProps = viz.model.getFullPropertyTree().then(function(props) {
		//Save current hyperCubeDef
		const hyperCubeDef = props.qProperty.qHyperCubeDef
		
		//Change dimension limit
		//You should loop over dimensions here, just select first dim as example
		hyperCubeDef.qDimensions[0].qOtherTotalSpec.qOtherMode = 'OTHER_COUNTED'
		
		//Set viz option qHyperCubeDef
		const newHypercubeDef = {qHyperCubeDef: hyperCubeDef}
		viz.setOptions(newHypercubeDef)
		
		viz.show("QV01")
	})
});

 

View solution in original post

1 Reply
alex_colombo
Employee
Employee

Hi @BenjaminGroff it is not clear to me why Dimension limit is not an option. Could you please describe this?
In anycase, you cannot change qInitialDataFetch from an existing chart. Here you can find a list of all properties from a table that you can change (setOptions Capability API method triggers ApplyPatches Engine API method behind the scenes).

I tried to apply a patch to the entire HyperCubeDef changing the limitation of the first dimension to 10 values. This works fine, below the code

app.visualization.get('mGVGsT').then(function(viz) {
	//Change qDimension qOtherTotalSpec for limiting dimension values
	const vizProps = viz.model.getFullPropertyTree().then(function(props) {
		//Save current hyperCubeDef
		const hyperCubeDef = props.qProperty.qHyperCubeDef
		
		//Change dimension limit
		//You should loop over dimensions here, just select first dim as example
		hyperCubeDef.qDimensions[0].qOtherTotalSpec.qOtherMode = 'OTHER_COUNTED'
		
		//Set viz option qHyperCubeDef
		const newHypercubeDef = {qHyperCubeDef: hyperCubeDef}
		viz.setOptions(newHypercubeDef)
		
		viz.show("QV01")
	})
});