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

Count number of buyer with 1st record within date selection

I have two simple tables as below, buyer and buyer activity. 1 buyer has multiple records in buyer activity which records number of times buyer interact with us.

elaineng_0-1673431848292.png

Each of the activity, we recorded type of channel customer interact with us and source information.

We need to analyze the information. Within the date selection in buyer activity, we need to count number of buyer with the most earlier (first record - sorted by buyer activity date) Source and Type for each of the buyer. 

Just a pivot table will do.

 

Labels (3)
1 Solution

Accepted Solutions
elaineng
Contributor III
Contributor III
Author

Hi @vikasmahajan , 

I have managed to work it out myself. Thanks.

Dimension:  Aggr(FirstSortedValue(Source ,date), buyerid)

Exp: count(buyerid)

View solution in original post

3 Replies
vikasmahajan

Not Sure but try this :

FirstSortedValue(buyer, -Aggr(count(buyer activity), Date))

or

Count( Aggr(FirstSortedValue(buyer activity, -date),buyer))

or

max(aggr(count(FirstSortedValue(buyer activity, -date)), buyer))

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
elaineng
Contributor III
Contributor III
Author

Hi @vikasmahajan , 

I have managed to work it out myself. Thanks.

Dimension:  Aggr(FirstSortedValue(Source ,date), buyerid)

Exp: count(buyerid)

vikasmahajan

if you found thread useful mark it with correct answer

Thanks

 

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.