Forum Discussion
Create Matrix From Five Columns
- 9 years agoHi mahmoud,
Assiming your data is in the format you present In the query view you need to select all the questions columns and unpivoted them you will get a table with 3 columns:
Answers type
Attribute - questions
Count
Then in the matrix visual put the columns in the index below:
Answers type - Rows
Attribute - columns
Count - values
This should give what you.want.
Regards,
MFelix - 9 years ago
Hi mahmoud,
I was looking at your data and I would do a simple treatment of the information. I would take all the reply and ID column into one table and unpivoted them so would have a table with 3 columns: ID, Question, answer them would do a table with the rest of the question (age, start end date, ...) also with ID and keep it as is and then do the relationship between both tables by ID this would give you the reply that you need for your visuals but also a base with additional information to make the age of respondent visuals, etc...
Regards,
MFelix
- 9 years ago
Hi mahmoud,
This is one thing I noticed in your data, in your replies you have columns that are text and others that are numbers, problably you should divide between two tables one with the text values and another with the number values that way you could do the statistic analysis in you data and the quality also.
Regards,
MFelix
Assiming your data is in the format you present In the query view you need to select all the questions columns and unpivoted them you will get a table with 3 columns:
Answers type
Attribute - questions
Count
Then in the matrix visual put the columns in the index below:
Answers type - Rows
Attribute - columns
Count - values
This should give what you.want.
Regards,
MFelix
- mahmoud9 years agoHelper I
Hi MFelix
Sorry to back to you late.
I have a question, after unpivot the columns, it will create many rows and that will effect on the other columns counted values ( the number of rows equal to number of new rows from unpivoted columns).
So if I have 30 culomns, and I would to unpivot some culomns and count the other ( I would to unpivot columns from 5 to 10, then the columns 11 to 14, then 16 to 20, and then 23 to 27). At the same time I have to count the values in column 1 and have charts from other columns(2,3,4,6,15,22,...etc).
As I tried for first time, the numbers of rows were equal to the number of rows in unpivoted columns, but that effected in the correct number.
I hope I am clear and get best way to fix that.
Thanks for you support!
Mahmoud
- MFelix9 years agoSuper User
Hi mahmoud,
You are correct when you say that there will be an increase on the other rows, because for each row you have it will multiplied bty the number of columns you unpivot.
I don't know how your data is set up but depending on the result you want/need you probably will have to do some further query changes or change the way your charts are calculated.
Without further information I cannot help you in the right way.
MFelix
- mahmoud9 years agoHelper I
HiMFelix thanks for your quick response.
Kindly find on this LINK an Excel file which is an example of the data I am working on.
I have many scenarios in my mind but I do not know which one is the best(fast and less storage)
(I have 30 questions multiple options which means 244 columns)
1- Create an Excel file for each questions (30 files) with the ID column then create relations between the tables.
2- Copy and Past the orginal table 30 times then remove the other columns then create relations between the tables.
After that in both cases unpivot the columns.
Which one is faster and need less storage? if that OK :).
If you have better solution, please let me know.
Thanks for your support!
Mahmoud