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: 
Not applicable

Count of rows in a straight table with if condition in expression

we have put if condition an an expression lets say for calculating values which are less that 25% . We are getting some rows in the straight table. But when I am trying to take count of rows in other text box somehow i am not able to get correct value. Can you please suggest what would be the correct expression and approach?

1 Solution

Accepted Solutions
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Something like this: count(aggr( if( ...something < 25%... ,1),Dim1,Dim2,...DimN)). Replace Dim1,Dim2,...DimN with the names of the dimensions in your straight chart.


talk is cheap, supply exceeds demand

View solution in original post

6 Replies
Not applicable
Author

I am getting values in a straight table and the count of rows i want in a different text box. Suppose in a straight table total no. of rows are 50 then in a text box i should get count as '50'. will that be possible with the above expression?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Something like this: count(aggr( if( ...something < 25%... ,1),Dim1,Dim2,...DimN)). Replace Dim1,Dim2,...DimN with the names of the dimensions in your straight chart.


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks a lot Gysbert. It worked. Just one more query, Suppose i have to get count by using dual condition like greater than 25% and less than 50% how should i use in the above expression?

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Just replace the if statement with a new if statement that tests both conditions. If( x > 25% and x < 50%,1)


talk is cheap, supply exceeds demand
Not applicable
Author

Hello Gysbert,

What if I have calculated dimension with an If statement also?

Regards,

Vishal

Not applicable
Author

Can I use aggr() or IF as a Dim1 and Dim2 etc. in the aggr expression suggested by you?

Please help I am in a fix