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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to count repeating values from 3 different columns

Hi Guys,

Few months ago I posted a question and I got the write answer.

How to tag Orders with YES/NO if customer name is same?

This question relates to the above mentioned post.

What would be the right expression to count to total orders where following fields are same?

[OrderDate], [Name], [StoreName]

I tried following but I am getting incorrect totals

Count(TOTAL <Name,OrderDate,StoreName> OrderId) > 1

1 Solution

Accepted Solutions
sunny_talwar

May be this:

=Count(DISTINCT Aggr(If(Count(TOTAL <Name,OrderDate,StoreName> OrderId) > 1, OrderId), OrderId, Name, OrderDate))

&

=Count(DISTINCT Aggr(If(Count(TOTAL <Name,OrderDate,StoreName> OrderId) = 1, OrderId), OrderId, Name, OrderDate))

View solution in original post

18 Replies
danansell42
Creator III
Creator III

Can you share a sample app please

MK_QSL
MVP
MVP

May be

COUNT(TOTAL <Name, OrderDate, StoreName>DISTINCT OrderID)

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Perhaps like this:

count({<OrderId={"=count(distinct [OrderDate]&'|'& [Name] &'|'& [StoreName]) )<>count([OrderDate]&'|'& [Name] &'|'& [StoreName])"}>}distinct OrderId)


talk is cheap, supply exceeds demand
Not applicable
Author

Thank you guys but your suggested solution does not work.

I have attached an example QVD in the post

Can you please try that?

Thank you

effinty2112
Master
Master

Hi Lokesh,

Try this:

Sum(Aggr(if(Count(OrderId)>1,1,0),Name,OrderDate,StoreName))

good luck

Andrew

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

=sum(aggr(if(Count(TOTAL <Name,OrderDate,StoreName> OrderId) > 1,1,0),OrderId,Name, OrderDate))


talk is cheap, supply exceeds demand
sunny_talwar

May be this:

=Count(DISTINCT Aggr(If(Count(TOTAL <Name,OrderDate,StoreName> OrderId) > 1, OrderId), OrderId, Name, OrderDate))

&

=Count(DISTINCT Aggr(If(Count(TOTAL <Name,OrderDate,StoreName> OrderId) = 1, OrderId), OrderId, Name, OrderDate))

Not applicable
Author

Thanks it is working

And where can I modify this expression to get the count of the rest of the orders where those 3 fields are not same.

Not applicable
Author

Thanks mate.