Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello users,
I have a problem with count in load script. It doesn't work, I think because there is no group by and no resident table. I don't know how to write the right command. The field "Signatur" is in the same table and has field @46.
Perhaps you can help me.
Thank you,
Inga
Ok, let's try that again with a little emphasis this time
All the fields not used in an aggregation function, like count, need to be included in the group by clause at the end of the load statement
That really means all. Every field you load that is not used in an aggregation function must be included in the group by statement. If you load 10 fields and use two fields in aggregation functions that means you should have 8 fields in the group by clause.
All the fields not used in an aggregation function, like count, need to be included in the group by clause at the end of the load statement:
Load A, B, count(C), D
from ...somewhere...
group by A,B,D;
load
signatur,
count(signatur)
resident tablename
group by signatur;
******************************
or also try this
load
A , // field on the basis of it perform count
count(signatur)
resident tablename
group by A;
Thanks Gysbert,
I think your answer is helpful for many people. But... on the screenshots you can see, that I not often work with SQL and functions.
But... I try... And I'm happy that it would be easy! When I know or better understand the answer, I will never forget it. Here's my nice try:
Looks soooo nice. But doensn't work.
Greets,
Inga
Hey Vishwaranjan,
nice, it looks so easy, but it doesn't work. The field "Signatur" with A @46 is in the same table like "Exemplazählung" with A @19.
Perhaps I can make the group by at the end of this table, like I've done it with Gysberts answer.
I don't want to give up. :-S
Greets,
Inga
Ok, let's try that again with a little emphasis this time
All the fields not used in an aggregation function, like count, need to be included in the group by clause at the end of the load statement
That really means all. Every field you load that is not used in an aggregation function must be included in the group by statement. If you load 10 fields and use two fields in aggregation functions that means you should have 8 fields in the group by clause.
Thank you for your patience.
Oooh, okay, there are 82 field that don't need a group by. Uiii, I have to try it.
Okay, it works like you said it.
count(@46) as Exemplarzählung
FROM...
group by @1, @2, @3 ... @83;
Thank you so much!
Inga