Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

urgent requirement_count of rows

Hello Community,

I have a table with nine dimensions and four expressions out of which 'something' is one of them.

I need to calculate the total number of rows in the straight table and display it in a text box.

I have 3 calculated dimensions in the table. The calculated dimension contains If statement and aggr functions.

I used the following expression in a text box to reflect the number of rows:

count(aggr( if( sum(something) >=0,1),Dim1, calculated Dim2(which has If statement),Dim3, calculated Dim4(which has aggr function), dim5....Dim9)).

The value returned by this expression is 0. I do not know the reason.

Please give me a way around this I am stuck up with this and this is extremely urgent.

PS: I have used NoOfRows(Total) in the expression of chart, but that is not my requirement.

       I have used  count(aggr( if( sum(something) >=0,sum(something),null()),Dim1, calculated Dim2(which has If statement),Dim3, calculated Dim4(which has aggr function), dim5....Dim9)) but it gives a very different and incorrect value.

Regards,

Vishal

G Wassenaar


5 Replies
tresesco
MVP
MVP

Try count( distinct ) with only the calculated dimension(for which you might have used 'Null Suppression') expression like:

=count(DISTINCT Aggr(if(Count(DISTINCT (SupervisorId))=1, ID),ID) )

Replace 'Aggr(if(Count(DISTINCT (SupervisorId))=1, ID),ID) ' with your calculated dimension expression.

Not applicable
Author

but can I use If and Aggr as my dimension expression in the count expression suggested by you?

That is the main issue I am facing it is returning me 0 when I use aggr or If

tresesco
MVP
MVP

I have used both (if and Aggr) in my expression and that works fine. but if your are talking about replacing the dimension in aggr (in my above expression: ID) by a calculated dimension, that is not possible. But again that might not be if you take the right calculated dimension within count() function. If any doubt, could you post your sample app?

Not applicable
Author


I am sorry I can not share the sample app. The expression suggested by you did not give me the correct result