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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
ashmitp869
Creator II
Creator II

Pivoting the data ?

Hi All,

Please help me out to pivoting the data.

I have a QVD file like below

ashmitp869_0-1638410327432.png

And the qliksense script is like this 

FORM_DASS21:
LEFT KEEP(FORM_DATA)
LOAD
FORM_ID,
"Anxiety score",
"Depression Score",
"I felt that life wasn't worthwhile",
"I found it hard to wind down",
"I was aware of dryness",
"I was aware of the action of my heart",
"I was intolerant of anything",
"I was unable to become enthusiastic",
"I was using a lot of nervous energy",
"I was worried about situations",
"Stress score",
"DASS 21 - Text",
"I felt that I was rather touchy",
"I couldn't seem to experience",
"I experienced breathing difficulty",
"I experienced trembling",
"I felt down - hearted and blue",
"I felt I was close to panic",
"I felt I wasn't worth much as a person",
"I felt scared without any good reason",
"I found it dif to work up the initiative",
"I found it difficult to relax",
"I found myself getting agitated",
"I had nothing to look forward to",
"I tended to over-react to situations"
FROM [lib://QVD/DASS.QVD]
(qvd);

Please anyone help with the script that will help to pivoting the data.

 

Thanks

 

Labels (1)
2 Replies
Vegar
MVP
MVP

Take a look at CROSSTABLE().

 

CROSSTABLE (Question, Answer,1)

LOAD

FORM_ID,

"Anxiety score",

"Depression Score",

"I felt that life wasn't worthwhile",

"I found it hard to wind down",

"I was aware of dryness",

"I was aware of the action of my heart",

"I was intolerant of anything",

"I was unable to become enthusiastic",

"I was using a lot of nervous energy",

"I was worried about situations",

"Stress score",

"DASS 21 - Text",

"I felt that I was rather touchy",

"I couldn't seem to experience",

"I experienced breathing difficulty",

"I experienced trembling",

"I felt down - hearted and blue",

"I felt I was close to panic",

"I felt I wasn't worth much as a person",

"I felt scared without any good reason",

"I found it dif to work up the initiative",

"I found it difficult to relax",

"I found myself getting agitated",

"I had nothing to look forward to",

"I tended to over-react to situations"

FROM [lib://QVD/DASS.QVD]

(qvd);

ashmitp869
Creator II
Creator II
Author

Hi Vegar , 

The data is like below -

data.PNG

after your CROSSTABLE() script

the data became like below -

data1.PNG

1.   Do you have any idea how to pivoting(row to column) is like how we have in the DASS form ?

 

2.    Does it will work with Generic Load ? Will you help me with the Generic Load script ?

 

Thanks