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: 
nikhilgarg
Specialist II
Specialist II

Group By Clause

Hey,

I ahve 2 tables. I want to have count on one column of 1st table but i have to put GroupBy function on columns in Second table.

How can we do this??

Thanks

9 Replies
PrashantSangle

Hi,

Can you explain with example??

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nikhilgarg
Specialist II
Specialist II
Author

I have table1 :

Item1 , Item2 , Item3

Table 2:

ITem4,

Item5;

I want to have count(Item1) group by item4 , item5 ?

Not applicable

You can to JOIN tables in script using JOIN keyword, as a result you will and up 1 table.

If you still want to keep both tables, Maybe you can  JOIN them in a temp table and bring back the aggregated value to one of the table by ApplyMap or another Join

Not applicable

Don't they have any common field ?

nikhilgarg
Specialist II
Specialist II
Author

Nope

richard_chilvers
Specialist
Specialist

Hi

I think they must have a common field otherwise your count will be meaningless.

If you can't share data with us, perhaps you can use sensible field names instead of Item 1 etc., so that we can help you.

PrashantSangle

Hi,

can i know how do you do this manually??

Please post sample data with required output.

Regards,

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
nikhilgarg
Specialist II
Specialist II
Author

Hey,

ALso i would like to know that, In pivot table ia hve 3 dimensions and 1 expression as COunt(Item). Now i want to execute same by sql query.

So in sql query do i have to use group by including all the dimensions that ahve been used??

richard_chilvers
Specialist
Specialist

Well, perhaps we can get the COUNT working first and then you can decide how best to use it.

I suspect your dimensions are the common fields you need to join your tables ?