Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Counting a distinct with condition straight table columns

Customer_Code     Year 2016 accounts     year 2017 accounts     average purchases/customer code     growing/declining account    count


i wish to count the column of growing/declining accounts which have only growing and declining based on the averages.

=COUNT(DISTINCT(CUSTOMER_CODE)) gives me the total accounts which doesnt differentiate whether it is growing or declining

i can only get the differentiated number when i search for growing / declining in the table itself.


Thanks in advance

5 Replies
sunny_talwar

Can you share few rows of data and explain what your expected output needs to be?

Not applicable
Author

Can you please explain it in detail. If possible share an example

Not applicable
Author

Untitled.png

(Growing/Declining Ac column)  =If(Num(Column(6))>num((Column(7))), 'Declining', 'Growing')

sunny_talwar

What is your expression behind Column(6) and Column(7) here? You will need to do something like this

Declining Count

Sum(Aggr(If(ExpressionColumn6 > ExpressionColumn7, 1), CUSTOMER_CODE))

Growing Count

Sum(Aggr(If(ExpressionColumn6 <= ExpressionColumn7, 1), CUSTOMER_CODE))

Not applicable
Author

I've solved it by using =(Column(9)) and total mode changed to sum of rows. Thanks for all the help btw :3