Qlik Community

Qlik Sense Integration, Extensions, & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Highlighted
alexrusin
New Contributor

Filter hypercube by several fields(dimensions)

Hi All

Could you please advice, how I can filter hypercube object by several fields?

For example I created HyperCube(by Engine API Explorer) with dimensions City and Year. And from qMatrix array I need get only Meansures where for example City = York and Year = 2000.

Is present some way to filter HyperCube by several dimensions?

Thanks! 

Tags (3)
Labels (3)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

Re: Filter hypercube by several fields(dimensions)

In your Measure def, use a set expression to limit by your criteria. For example:

=sum({<City={'York'}, Year={2000}>} Sales)

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

4 Replies
MVP & Luminary
MVP & Luminary

Re: Filter hypercube by several fields(dimensions)

In your Measure def, use a set expression to limit by your criteria. For example:

=sum({<City={'York'}, Year={2000}>} Sales)

-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

alexrusin
New Contributor

Re: Filter hypercube by several fields(dimensions)

Thanks, solution work as well!
Gappodi
New Contributor

Re: Filter hypercube by several fields(dimensions)

Rob,
Is there a way to set these selections through some structures (like Generic Object with qListObjectDef or Field Class with Select Method)?
Thanks
MVP & Luminary
MVP & Luminary

Re: Filter hypercube by several fields(dimensions)

You could make the selections using one of the select methods and then the hypercube would reflect those selections.  I'm not aware of a structure you could include in the hypercube def, but I would not be surprised if there is a way.  I'm always learning something new about the Engine API.

-Rob