Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
madmax88
Creator II
Creator II

Sum Distinct rangesum over months

Hi,

Following table:

Order IDDateCust_IDCustomer_Stats
112.01.201922activ
220.02.201922activ
301.01.201923activ
401.03.201924activ
501.02.201924activ

 

I need the distinct rangesum over time of the Customer_ID. I have following expression:

rangesum(above(Count({$<Customer_status={'activ'}>} Distinct(Cust_ID)),0,RowNo()))

This expression shows me if there are Sales in the specific month. If there are Sales in 2 Months i shows me 1 in the first month and in the second month 2 (accumulated), but I need only to know when the first sale happened and then ignore the following sales. Is this possible?

E.g. Cust_ID 22 has 2 Sales (Jan and Feb). Result should be "1" in Jan and 1 in Feb , because there is already a Sale in Jan.

2 Replies
sunny_talwar

Best way to do this is to use the The As-Of Table

madmax88
Creator II
Creator II
Author

I know what you mean, but this is not the problem (I tried your solution). The Problem is still that a Customer is counted for each month where an Order ID exists.