Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Davidb69
Contributor
Contributor

Pivot Table Question Qlikview

So I am pretty new to Qlikview(I was introduced last year and we started development this year). There is one issue on one report that I can't seem to escape. When I am doing a Pivot table, I am looking to count the number of Orders  each customer has made during a time frame by towns. 

So if John lives in Philly and made 2 orders, 

Bob lives in Pittsburgh and made 1 order

Sue also lives in Pittsburgh and made 1 order

 

in my Pivot table I am currently seeing this

      Town                    Orders                                    Customers

Philadelphia                 2                                               1  

Pittsburgh                      1                                              2

 

I'd like to see 1 or more or 2 or more etc.  This way I know how many orders were made in each town. 

So it should look like this

      Town                    Orders                                    Customers

Philadelphia                 1                                               1  

Philadelphia                 2                                               1  

Pittsburgh                      1                                              2

 

 

In the pivot table dimensions

I have TOWN and

for the orders I have a calculated Dimension

=AGGR(COUNT(DISTINCT ORDERNUM), CUSTACCT)

In expressions I have

=rangesum(above(count(distinct CUSTACCT),0,50))

 

Thanks in advance for the assistance.

Labels (3)
6 Replies
sunny_talwar

Your output requirement is not very clear... would you be able to elaborate a little on this?

Davidb69
Contributor
Contributor
Author

What I am trying to gain here, is I want to know how many customer reorders there are by Town.

 

So I want to know 1 and more, 2 and more, 3 and more, 4 and more etc.

Issue right now is if there is no 1 order but there are 2+, nothing would populate in that column giving the total of the 1 and more orders an incorrect total.

 

 

 

 

sunny_talwar

Still not 100% sure I understand... Table1

image.png

Is the Orders field here Count of orders?

image.png

And this one it the actual order? How is Philly getting divided into two?

Davidb69
Contributor
Contributor
Author

Yes, Philly would have 2 rows, one show 1 and more orders and one showing 2 and more orders.

 

 

 

sunny_talwar

I don't see how... Can you share the raw data behind this output?

Davidb69
Contributor
Contributor
Author

No problems, I can replicate in this excel sheet to help you understand a bit more. 

Main data is a snipet of actual data from orders for this year in certain areas.

The first pivot gives me the number of orders per town/customer

Final pivot shows the number of customers and how many they ordered and 

K4:R9  is the expected output from QLIKVIEW. Items in Yellow are totally missing right now as it's programmed.

Thank you.

Dave