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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Stacked chart with 2 separated variables

Hi friends,

Please help me with idea how to make stacked chart with 2 separated variables.

Capture.JPG.jpg

Please find my QV file.

Thanks,

1 Solution

Accepted Solutions
Nicole-Smith

Change your load script to:

CrossTable(Type,Answer,2)

LOAD respondentID, surveyID, [qID_16630_128092_Business travel] as Business, [qID_16630_128093_Leisure travel] as Leisure;

SQL SELECT [respondentID]

      ,[surveyID]

      ,[qID_16630_128092_Business travel]

      ,[qID_16630_128093_Leisure travel]

FROM [aaa_787];

Then on your chart:

Dimension 1: Type

Dimension 2: Answer

Expression: count(Answer)/count(total <Type> Answer)

Example file is attached.

View solution in original post

2 Replies
Nicole-Smith

Change your load script to:

CrossTable(Type,Answer,2)

LOAD respondentID, surveyID, [qID_16630_128092_Business travel] as Business, [qID_16630_128093_Leisure travel] as Leisure;

SQL SELECT [respondentID]

      ,[surveyID]

      ,[qID_16630_128092_Business travel]

      ,[qID_16630_128093_Leisure travel]

FROM [aaa_787];

Then on your chart:

Dimension 1: Type

Dimension 2: Answer

Expression: count(Answer)/count(total <Type> Answer)

Example file is attached.

Anonymous
Not applicable
Author

Thanks Nicole.