Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
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
its_anandrjs
Champion III
Champion III

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

View solution in original post

9 Replies
Not applicable
Author

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

sum(sent#)

Sum(sentontime#)

its_anandrjs
Champion III
Champion III

Hi,

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

See the attached sample file

Rgds

Anand

SunilChauhan
Champion II
Champion II

here is the exact result you want

see the attached file

Sunil Chauhan
its_anandrjs
Champion III
Champion III

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
Author

Thank you .

It was very helpful!!!!

SunilChauhan
Champion II
Champion II

hello julierizkallah ,

did you check my post ,is it wrong ?

Sunil Chauhan
Not applicable
Author

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

SunilChauhan
Champion II
Champion II

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

its deserves right answer.

Sunil Chauhan
Not applicable
Author

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