Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
materi
Contributor III
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
materi
Contributor III
Contributor III
Author

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!

View solution in original post

2 Replies
materi
Contributor III
Contributor III
Author

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.

materi
Contributor III
Contributor III
Author

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!