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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
ferha_jafri
Partner - Creator III
Partner - Creator III

How to count positive values in a column

Hello everyone,

It is very urgent ,the issue is i want to count no of positive values greater that 0 in a column.How can i write an expression as that column is doing a division of two previos columns.

Thanks in advance

Ferha Jafri

1 Solution

Accepted Solutions
VishalWaghole
Specialist II
Specialist II

Hi Ferha,

Make Flag for negative and positive values on script level like

if(Column_Value > 0,'POSITIVE','NEGATIVE') as FLAG

then use this flag for in your count expression like

Count({<FLAG = {'POSITIVE'}>}Column_Value)

Thanks and Regards,

Vishal Waghole

View solution in original post

12 Replies
Not applicable

if(column_Result > 0 , 1 ,0) and sum it

Not applicable

Hi,

To count the positive values then use the below expression:

Count({<Coulmn1 = {'>0'}>} Coulmn1)

I am not sure, what do you mean by "How can i write an expression as that column is doing a division of two previos columns."?

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

no it is not like this ,i want to count no of rows for which the expression is positive as i have to divide some expression with that count.

Not applicable

Hi Ferha,

Can you post sample script or attached qvw, so that we can check what exactly you are looking for.

Regards,

NR

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

this expression is not working.

ferha_jafri
Partner - Creator III
Partner - Creator III
Author

The situation is that i want to calculate avg but if i use avg function it is dividing the result with total no of rows although i want to divide that expression with the count of positive values.

Not applicable

Can you post a sample app?

Not applicable

Hi,

Try to divide your expression with "Count({<Coulmn1 = {'>0'}>} Coulmn1)". Is it make sense?

sujeetsingh
Master III
Master III

Try this

=if(Left(Result,1)='-',Result,0)

See this sample for reference