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

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
Dwyane
Contributor II
Contributor II

Usin max value in a linechart

Hello all,

I have a table like this

 

MonthCustomer NamePaidCollectedActual
1John Smith100100010%
2John Smith200105019%
3John Smith300110027%
1Kirk Polly250115022%
2Kirk Polly355120030%
3Kirk Polly865125069%


 The actual column is calculated by Collected divided by Paid. What i want to do is identify the max month so int examples is 3 for both customers and then use the collected amount for the max month and use that value to  divide by the paid for each month. So month 1 for John Smith would be 300/1100 month 2 would be 200/1100   Any idea how i can do this in a line chart where i plot the calculated actual using the month and customer name as dimensions.

 

Thanks in advance! 

Labels (1)
1 Solution

Accepted Solutions
tincholiver
Creator III
Creator III

hi Dwyane, 

I hope this is the solution you are looking for: in the dimensions of the graph there is Customer Name and Month, in the expression
1. aggr (NODISTINCT FirstSortedValue (Collected, -Month), [Customer Name]) returns the value of the collection of the last month
2. sum (Paid) sum the payments
3. sum (Paid)
/
aggr (NODISTINCT FirstSortedValue (Collected, -Month), [Customer Name]) is the expression you need

 

tincholiver_0-1629380053900.png

 

tincholiver_1-1629380077156.png

 

View solution in original post

3 Replies
tincholiver
Creator III
Creator III

hi Dwyane, 

I hope this is the solution you are looking for: in the dimensions of the graph there is Customer Name and Month, in the expression
1. aggr (NODISTINCT FirstSortedValue (Collected, -Month), [Customer Name]) returns the value of the collection of the last month
2. sum (Paid) sum the payments
3. sum (Paid)
/
aggr (NODISTINCT FirstSortedValue (Collected, -Month), [Customer Name]) is the expression you need

 

tincholiver_0-1629380053900.png

 

tincholiver_1-1629380077156.png

 

tincholiver
Creator III
Creator III

If you put the month as a dimension first and then the name of the client you would have something like this:

 

tincholiver_2-1629380218192.png

 

tincholiver
Creator III
Creator III

Sorry, you were looking to graph the data in lines, it would look something like this

 

tincholiver_0-1629380854783.png