Qlik Community

Qlik Sense Integration, Extensions, & APIs

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

Announcements
Save the Date: QlikWorld Online, June 24-25, 2020. Free global virtual event for data integration and data analytic gurus. Register Today
Highlighted
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
Highlighted
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

View solution in original post

4 Replies
Highlighted
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

View solution in original post

Highlighted
New Contributor

Re: Filter hypercube by several fields(dimensions)

Thanks, solution work as well!
Highlighted
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
Highlighted
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