Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Sum with condition

Hey all,

Im quite new to QlikView, although i am able to setup queries and output some graphs, i am now working on a more detailed view of the data and require some help.

I have a graph in my sheet with a sum of turnover, however i want to show only the sum of the turnover when column TypeRegel = 'Verkoop', i found some material on this subject and created the following expression:

=Sum({$ < Typeregel = {'*Verkoop*'}>} Bedrag)

However the graph does not seem to change when i put this expression in and is still summing the total of all records.

What am i doing wrong?

3 Replies
Not applicable
Author

Hi,

Use double quotes instead of single quotes.

Sum({$ < Typeregel = {"*Verkoop*"}>} Bedrag)

Single quotes expect exact values to be passed and double quotes accepts case insensitive wild-card searches.

Just check this and let me know, if it still does not work.

..

Ashutosh

v_iyyappan
Specialist
Specialist

Hi,

     Use the below expression you will get the exact value.

=Sum({$<Typeregel= {'Verkoop'}>} Bedrag)

Regards,

Iyyappan

Not applicable
Author

Yes,

=Sum({$<Typeregel= {'Verkoop'}>} Bedrag)

This will give him sum only for Verkoop  (Case sensitive)

and this

Sum({$ < Typeregel = {"*Verkoop*"}>} Bedrag)

will give him results for all the Typeregel  wherever string Verkoop exists.(Case - insensitive)

So, if he has a Typeregel as "New Verkoop" and another as "Verkoop".

he will get sum of both these values but in 1st one he will get only for later one (Verkoop).

So, It all depends on the requirements but as in his question he has used *Verkoop*, So I had used "*Verkoop*".

..

Ashutosh