Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
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?

Tags (1)
1 Solution

Accepted Solutions
MVP & Luminary
MVP & Luminary

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

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
6 Replies
Not applicable

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

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?

MVP & Luminary
MVP & Luminary

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

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

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

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?

MVP & Luminary
MVP & Luminary

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

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

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

Hello Gysbert,

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

Regards,

Vishal

Not applicable

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

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