Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
abdul-qadir
Partner - Contributor
Partner - Contributor

Measure corresponding to specific set of dimensions

Hi,

I am building a Qlik Sense Extension that has two dimensions and two measures. What I need is that the measure one values should be calculated on unique combination of values of both the dimensions (which is the default behavior), but measure two values should be calculated on unique values of only dimension one.

So for example, if my data is:

ABC
1210
1210
1310
4510

 

And I chose dimension 1 as "A", dimension 2 as "B" and both measures as sum of "C", then in my extension,  "layout.qHyperCube.qDataPages[0].qMatrix" should return the following table.

dimension1dimension2measure1measure2
122030
131030
451010

 

It has one row per unique combination of values of dimension1 and dimension2. The measure1 is calculated on each unique combination of values of dimension1 and dimension2 (which is the default behavior). The measure2 is what I need help with. It should be calculated on each unique values of just dimension1 (and dimension2 should be ignored).

Is this possible. If so, how?

Labels (1)
2 Replies
Vegar
MVP
MVP

I didn't quite follow your descriptive text, but I think I'm able to help you to calculate your desired output anyhow.

See attahed picture and script below. 

image.png

LOAD recno() as RecNo, * Inline [
A	B	C
1	2	5
1	2	5
1	3	5
] (delimiter is '	');
abdul-qadir
Partner - Contributor
Partner - Contributor
Author

Thanks for the reply @Vegar .

I have updated my original post to better explain what I need.

I want to solve it in the extension code if possible and not in load script of app.