Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

counting customers by first order only

Hi

I'm trying to create a graph to show by week (x axis) and status (stacked)  the number of customers that have placed their first order in that week.

I can't write this into the script as the count needs to change based on which promotion is selected in a filter.

I think i need to use an aggr but i'm not sure if i write this as a calculated dimention or within the chart expression.

can any one help please?

essentially: count the customers in each week where their first order fits xyz criteria.

many thanks

H

1 Solution

Accepted Solutions
Not applicable
Author

I think i have solved my issue using a calculated dimention

Aggr(min({<ItemJobNumber = p([Job Number])>} [Financial Week]), CustomerNumber)

View solution in original post

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

This will be much easier to answer if you can upload your qvw or a representative sample. That way we don't need to guess at fields names or the data structure, and you will get more accurate and useful responses.

Preparing examples for Upload - Reduction and Data Scrambling

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
sunny_talwar

May be just flag the first encounter with the customer in the script. This should still allow you to be dynamic. May be if you can share some sample data, it can be demonstrated.

Not applicable
Author

Hi

Thanks for your comments so far, apologies but I can’t provide a sample set of data at present.

So far I have Financial week and Status in the dimensions, and the following in the expression;

count ({<ItemJobNumber = p([Job Number])>}distinct  CustomerNumber)

I just need to restrict the count of the CustomerNumber to the first instance the criteria above is met.

Not applicable
Author

I think i have solved my issue using a calculated dimention

Aggr(min({<ItemJobNumber = p([Job Number])>} [Financial Week]), CustomerNumber)