Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Sum records based on a condition

Hi!

I would like to Sum the [# sent] and [# sent on time] for each country when I select specific months. For the below example, if I select Jan-11, Feb-11, and Mar-11, I need to have the total for each country according to the months selected.

Original table is

CountryMonth# sent# sent on time% on time
Country AJan-1144100.00
Country AFeb-115480.00
Country AMar-1133100.00
Country BJan-1177100.00
Country BFeb-1122100.00
Country BMar-118787.50
Country CJan-1155100.00
Country CFeb-111010100.00
Country CMar-1111100.00
Country DJan-1144100.00
Country DFeb-119888.89
Country DMar-1177100.00

I need the totals to figure in a table as per the below. the percentage is recalculated based on the new numbers.

# sent# sent on time   % on time
Country A121191.67
Country B171694.12
Country C1616100.00
Country D201995.00

I would highly appreciate your help,

Regards,
Julie

1 Solution

Accepted Solutions

Re: Sum records based on a condition

Hi,

Use

Dimension -> Country

Expression1 -> sum([# sent])

Expression2 -> Sum([# sent on time])

Expression3 -> Sum([# sent on time]) / sum([# sent]) and set decimal place 2 and fixed to 2 and show in % in chart properties

See the update file with percentage, see the pivot chart.

Rgds

Anand

9 Replies
Not applicable

Sum records based on a condition

Just create a straight or Pivot table with the only dimension= Country

sum(sent#)

Sum(sentontime#)

Re: Sum records based on a condition

Hi,

Use pivot table and create a chart like add sum of values

See the attached sample file

Rgds

Anand

SunilChauhan
Esteemed Contributor

Re: Sum records based on a condition

here is the exact result you want

see the attached file

Re: Sum records based on a condition

Hi,

Use

Dimension -> Country

Expression1 -> sum([# sent])

Expression2 -> Sum([# sent on time])

Expression3 -> Sum([# sent on time]) / sum([# sent]) and set decimal place 2 and fixed to 2 and show in % in chart properties

See the update file with percentage, see the pivot chart.

Rgds

Anand

Not applicable

Sum records based on a condition

Thank you .

It was very helpful!!!!

SunilChauhan
Esteemed Contributor

Re: Sum records based on a condition

hello julierizkallah ,

did you check my post ,is it wrong ?

Not applicable

Re: Sum records based on a condition

At the contrary. It was very correct. But i could only post Correct Answer one time

SunilChauhan
Esteemed Contributor

Sum records based on a condition

i am not bother but  you should check on first come first serve basis .

its deserves right answer.

Not applicable

Re: Sum records based on a condition

It's my first time that i post there so i thought i could mark all correct answers. Next time i will do for sure