Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 - Text | Type 1 - Internet | Type 2 - Email | Type 2 - Text | Type 2 - Internet |
---|---|---|---|---|---|---|
UK | 1 | 1 | 1 | 0 | 1 | 1 |
USA | 1 | 1 | 0 | 1 | 1 | 0 |
India | 1 | 0 | 0 | 1 | 1 | 0 |
UK | 0 | 0 | 0 | 0 | 0 | 1 |
UK | 0 | 0 | 0 | 1 | 1 | 1 |
India | 0 | 1 | 1 | 1 | 0 | 1 |
USA | 1 | 1 | 1 | 1 | 1 | 0 |
USA | 1 | 1 | 1 | 0 | 1 | 0 |
USA | 1 | 1 | 1 | 0 | 1 | 1 |
UK | 1 | 1 | 1 | 1 | 1 | 0 |
UK | 1 | 1 | 0 | 1 | 0 | 1 |
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.
Does anyone have any idea how to achieve this?!
Many thanks for your help,
Katie
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])))
Hi,
see attached file.
Hope it helps
Regards
Giampiero
Ups the file 🙂
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])))
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
Thanks again!
Katie
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