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

Need to extract customer ids of the maximum transaction defined as a measure

Hey everyone, 

I am really new to qlik and lately I have been struggling for a while to extract information from the data.

So here's the problem, I have a source table of transaction per customer which contains transaction id, transaction date, customer id, transaction amount, bonus, store location and a dimension table which contains customer related information.

I have defined a measure called Maximum transaction which seem to link correctly with store location (see pic 1), however when I add a customer id dimension to the table it seem to return maximum amount for all customers that made purchase at the given location (see pic 2):

pic 1

Store idLargest transaction
in october 2019
Bonus saved
1510000010

 

pic 2

Store idLargest transaction
in october 2019
Bonus savedCustomer id
151000001023
1590000924
15870001215
1545000812
1514000772
1512500645

 

The measure for maximum amount is defined with the following setAnalysis expression

Max (
{
$<[transaction_calender_year_number]       =  {"$(=var_selected_year_number)"},
     [transaction_calender_month_number]  =  {"$(=var_selected_month_number)"}>
}
[transaction_amount])

 

where I basically define that I need maximum transaction for a certain year and month. As far as I understand in order to link it correctly with customer id and customer related information I need to use aggregation function, but I struggle to implement it correctly.

Any help is highly appreciated

 

Labels (1)
3 Replies
JordyWegman
Partner - Master
Partner - Master

Hi Bogdan,

What were you expecting in Pic 2? 

Jordy

Climber

Work smarter, not harder
bogdan90
Contributor
Contributor
Author

Hey Jordy, I was expecting only the first row

JordyWegman
Partner - Master
Partner - Master

In that case, try this in your customer dimension:

 

=IF(Transaction = Max(Total Transaction ),Customer,null())

 

Your dimension will split it, but with this formula it will only get the one with the largest  transaction.

Jordy

Climber

Work smarter, not harder