Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

materi
New Contributor III

How to code that the USER SELECTED number of rows in a pivot table should be calculated?

I posted a question previously with the same code, so here it is again:

307.699 * count(Period)

What I want that expression to do is what I describe in the topic, but what it does is simply count the total number of rows in the field Period and returns the product of that and the given number.

How do I make Qlik only return the user selected number of rows in the field Period instead?

1 Solution

Accepted Solutions
Highlighted
materi
New Contributor III

Re: How to code that the USER SELECTED number of rows in a pivot table should be calculated?

Aha, it turns out I had more than one of the same post in my dataset, so I used count(distinct[attribute]). That solved it. Thanks me!

2 Replies
materi
New Contributor III

Re: How to code that the USER SELECTED number of rows in a pivot table should be calculated?

The field Period contains dates of weeks as such: 201540, 201541, 201542 and so on. But I don't think that should matter, because of the count argument, which should only make it count rows in the field, as specified by the user. Why doesn't it do that?

For example, I selected one week (201540) and the result was 251764.4 which is not equal to 307.699 * 1.

Highlighted
materi
New Contributor III

Re: How to code that the USER SELECTED number of rows in a pivot table should be calculated?

Aha, it turns out I had more than one of the same post in my dataset, so I used count(distinct[attribute]). That solved it. Thanks me!