Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

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
Valued Contributor III

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

You may use the following:

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

2 Replies
nagaiank
Valued Contributor III

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

You may use the following:

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

Not applicable

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

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.

Community Browser