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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Number of rows in a straight table with Group field

Hi,

I have to count the number of rows of a straight table.

I found the formula =Sum(Aggr(1,Field)) reading the forum and it works properly with a defined fields but it doesn't work with a Group Fields.

Could anyone help me, please?

Nick.

8 Replies
swuehl
MVP
MVP

Try

=Sum(Aggr(1, $(=GetCurrentField( GROUP) ) ))

Anonymous
Not applicable
Author

Thank you for the answer by it doesn't work (only a "-" is the result)

N.

swuehl
MVP
MVP

What does

=$(=GetCurrentField( GROUP) )

return in a text box when you cycle / drill through your GROUP (of course you need to replace GROUP with the group name you are actually using)?

Anonymous
Not applicable
Author

Same result

I attach the example.

Thank you.

N.

swuehl
MVP
MVP

Seems to work for me, check attached.

Anonymous
Not applicable
Author

Pls. check the title formula: I'd like to show there the number of rows of the straight table (4 in the customer group, 3 in the year group).

Thanks

swuehl
MVP
MVP

Ok, missed that, but the expression I suggested in my first post seems to work just fine, too.

Anonymous
Not applicable
Author

Well, I had discovered the mystery .

In the example I gave you I didn't care about the fact that the group field is conditioned, and in this case your suggestion doesn't work, because it shows 0.

I also made a workaround to show the desired title on the graph (making a comment at the end of the conditional group) and in this case the Sum(Aggr formula shows a '-'.

In the example now I attached the two versions (however the only is functional form me is the second one).

Thank you if you want go give a suggestion to me and I apologize because I didn't post the complete example the first time.

N.