Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
rathorep
Contributor III
Contributor III

Count with group on 2nd column

Hello,

I did find some solution to similar question but unfortunately, non of them gave me desired result.

Below is my question, I have a table with ticket number and group name who modified the ticket.

I have to calculate, how many times group has modified each ticket.

 

Ticket NoGroup Name 
17698506A 
17698506B 
17698506A 
17698506C 
17698566A 
17698566B 
17698566B 
   
Required result  
   
Ticket NoGroup NameCount of Group name for each ticket
17698506A2
17698506B1
17698506C1
17698566A1
17698566B2

 Thanks!!!!

2 Solutions

Accepted Solutions
Taoufiq_Zarra

@rathorep  like ?

 

Data:
LOAD * INLINE [
    Ticket No, Group Name
    17698506, A
    17698506, B
    17698506, A
    17698506, C
    17698566, A
    17698566, B
    17698566, B
];

output:

load [Ticket No], [Group Name],count([Ticket No]) as [Count of Group name for each ticket] resident Data group by [Ticket No], [Group Name];

drop table Data;

 

 

output:

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉

View solution in original post

Kushal_Chawda

@rathorep  look at below. based on your example I have created below

Screenshot 2020-10-12 104719.png

View solution in original post

8 Replies
Taoufiq_Zarra

@rathorep  like ?

 

Data:
LOAD * INLINE [
    Ticket No, Group Name
    17698506, A
    17698506, B
    17698506, A
    17698506, C
    17698566, A
    17698566, B
    17698566, B
];

output:

load [Ticket No], [Group Name],count([Ticket No]) as [Count of Group name for each ticket] resident Data group by [Ticket No], [Group Name];

drop table Data;

 

 

output:

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Kushal_Chawda

@rathorep  create a table with Dimension Ticket No & Group Name with expression count(Group_Name)

rathorep
Contributor III
Contributor III
Author

I am fetching data from QVD and i have to do this directly in chart.

rathorep
Contributor III
Contributor III
Author

Hello @Kushal_Chawda , it will give big count for each group and on putting disctinct , its only giving 1 for each group.

Taoufiq_Zarra

@rathorep 

chart

dimesntion : ticket No and Group name

measure count(Ticket No)

like :

Capture.PNG

Regards,
Taoufiq ZARRA

"Please LIKE posts and "Accept as Solution" if the provided solution is helpful "

(you can mark up to 3 "solutions") 😉
Kushal_Chawda

@rathorep  look at below. based on your example I have created below

Screenshot 2020-10-12 104719.png

rathorep
Contributor III
Contributor III
Author

Hello,

when I am doing same as you suggested on dummy data , I am getting correct result.

But when I am doing same in new sheet of my APP, its giving wrong result, like for this ticket count is getting multiplied by 6 , and for other records as well its getting multiplied by 2 or 5 or some random number. I am not sure how the count is getting multiplied.

Ticket NoGroup NameCount of Group name for each ticket Result I am getting 
17698506A2*612
17698506B1*66
17698506C1*66
17698566A1*66
17698566B2*612
rathorep
Contributor III
Contributor III
Author

Is there any other way we can do this calculation?