4 Replies Latest reply: Sep 27, 2016 1:17 PM by Rafael Souza

# sum of expression with only one criterie

Hello people,

First I thank all members of this community forum so far helped me a lot at the beginning of learning and use of QlikView, you are very collaborative!

I'm racking my brain to make a conditional sum function,

I have data table below:

Classify the values of [DsFilial] in the following form:

1) CP: where [DsFilial] like 'CP*'

2) VEIC: where [DsFilial] not Like 'CP*'

I tried using the following expression without success:

Sum ({\$ <[DsFilial] like { 'CP*'}>} Qtd)

I also tried to create a field for such a definition [Channel] that performs this distinction

"if (DsFilial like 'CP*', 'CP', 'VEIC') as 'Channel'

in data load and pointed expression to the created field, but also not I succeeded:

Sum ({\$ <[Channel] = {'CP'}>} Qtd)

Can show me the correct way to expression work?

• ###### Re: sum of expression with only one criterie

May be like this:

Dimension

Channel

Expression

Sum(Qtd)

• ###### Re: sum of expression with only one criterie

Or you can use a calculated dimension

If(DsFilial like 'CP*', 'CP', 'VEIC')

Expression

Sum(Qtd)

• ###### Re: sum of expression with only one criterie

Sum ({\$<DsFilial={'CP*'}>} Qtd)

• ###### Re: sum of expression with only one criterie

It worked perfectly, another lesson learned, thank you guys