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

Summarise data whilst still being able to make selections

Hi there,

I have the results of a survey in a database table.  The table is in the following format and has been loaded alongside hundreds of other survey answers. 

We have asked people about how they would like to receive different types of messages.  If they like to receive Type 1 messages by text and email, they tick those checkboxes in the survey and the results appear as a 1 in the database.  If they don't tick the box, the value in the database is 0.  In a previous question they are asked which country they are from.

Country Type 1 - Email
Type 1 - TextType 1 - InternetType 2 - EmailType 2 - TextType 2 - Internet
UK111011
USA110110
India100110
UK000001
UK000111
India011101
USA111110
USA111010
USA111011
UK111110
UK110101

I would like to display the above data in QlikView in the following way and still have the option to create a listbox for Country so that I can make selections to view the results for the selected country.

chart.jpg

Does anyone have any idea how to achieve this?!

Many thanks for your help,

Katie

1 Solution

Accepted Solutions
Not applicable
Author

You can achieve this with only one expressions for each Type.

Use the IF condition to get the result.

E.g:

'Type' as dimension

Email:

if(Type='Type1',Sum([Type 1 - Email]),if(Type='Type2',sum([Type 2 - Email])))

Text:

if(Type='Type1',Sum([Type 1 - Text]),if(Type='Type2',sum([Type 2 - Text])))

Internet:

if(Type='Type1',Sum([Type 1 - Internet]),if(Type='Type2',sum([Type 2 - Internet])))

View solution in original post

5 Replies
Not applicable
Author

Hi,

see attached file.

Hope it helps

Regards

Giampiero

Not applicable
Author

Ups the file 🙂

Not applicable
Author

You can achieve this with only one expressions for each Type.

Use the IF condition to get the result.

E.g:

'Type' as dimension

Email:

if(Type='Type1',Sum([Type 1 - Email]),if(Type='Type2',sum([Type 2 - Email])))

Text:

if(Type='Type1',Sum([Type 1 - Text]),if(Type='Type2',sum([Type 2 - Text])))

Internet:

if(Type='Type1',Sum([Type 1 - Internet]),if(Type='Type2',sum([Type 2 - Internet])))

Not applicable
Author

Thank you so much to you both!

Giampiero - your file was extremely useful.  Couldn't have done it without it.  The only issue I had was that the colours of the second bar didn't match the legend (see below).  But I edited the expressions to match what Syed had suggested and both your answers combined worked perfectly

chart2.JPG

Thanks again!

Katie

Not applicable
Author

Thank you both so much for your answers!

Giampiero - the file you attached was very useful indeed - couldn't have done it without it!  The only issue I had was that the colours on the second bar didn't match the legend (see below).  So I edited the expressions to match what Syed suggested below and it worked perfectly!

Thanks again!

Katie

chart2.JPG