Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
rafaeloneil
Contributor III
Contributor III

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:

chart2.png

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' 

chart2.png

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?

4 Replies
sunny_talwar

May be like this:

Dimension

Channel

Expression

Sum(Qtd)

sunny_talwar

Or you can use a calculated dimension

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

Expression

Sum(Qtd)

Anonymous
Not applicable

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

rafaeloneil
Contributor III
Contributor III
Author

It worked perfectly, another lesson learned, thank you guys