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

Expression : condition before a sum (condition avant de sommer)

Bonjour / Hello

I just started with Qlikview but i could not find out what i easily did with MS Access :

I want to sum a numeric field but only when a varchar field contains part of a text which is in another field.

This should be very simple..

Field 1 : murex

Field 2 : direct costs murex

Field 3 : costs (numeric field)

I want to make a sum only for the rows for which we find "murex" in "direct costs murex"   (we exclude direct costs application XXYY)

A few try but that does not work :

If(Field 2 like '*Field 1*'; Sum (costs);0)

Thanks for your help !

1 Solution

Accepted Solutions
nagaiank
Specialist III
Specialist III

You may use the following:

Sum(If(Index(Field2, Field1) > 0,costs,0))

View solution in original post

2 Replies
nagaiank
Specialist III
Specialist III

You may use the following:

Sum(If(Index(Field2, Field1) > 0,costs,0))

Not applicable
Author

Thanks a lot ! It works.

I did not see so many examples in the Qlikview reference manual for expressions. It is generic. If a valuable source exists for examples, do not hesitate to tell me.