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: 
Not applicable

Union 2 columns (Not in script)

Hello

Attached excel. I am trying to union 'Dr1', 'Dr2' and 'Dr3' to one column (not distinct). The Column B/N1, B/N2, B/N3 is the Dr answers.

The last column B/N is the correct answer.

I am comparing the Dr answer and the correct answer,

So Union table should look like this (2 columns):

rob  Yes

joe  Yes

max  Yes

rina  No

joe  Yes

rob  No

Nuna  No

mike  Yes

joe  Yes

rina  Yes

joe  Yes

mike  Yes

After the union i am going to count each name and the number of the correct answers, its gonna look like this (2 columns):

rob  1

joe  4

max  1

rina  1

mike  2

I don't want to do it in the script because I am going to have problems in filtering after. am i right?

Thank you for helping!

1 Solution

Accepted Solutions
petter
Partner - Champion III
Partner - Champion III

Doing the correct transformations in your load script makes it much easier to get exactly what you want in your dashboard:

2017-01-31 18_31_34-Qlik Sense Desktop.png

2017-01-31 18_32_40-Qlik Sense Desktop.png

View solution in original post

3 Replies
vinieme12
Champion III
Champion III

You will need to do it in script

LOAD [case num],

     [Dr 1] as DR,

     [B/N 1] as Answered,

     [B/N] as CorrectAnswer,

     'DR1' as DR_Instance,

     if([B/N 1] = [B/N],1,0) as ResponseFLAG

FROM

(ooxml, embedded labels, table is Sheet1);

concatenate

LOAD [case num],

     [Dr 2],

     [B/N 2],

     [B/N] as CorrectAnswer,

  'DR1' as DR_Instance,

      if([B/N 1] = [B/N],1,0) as ResponseFLAG

FROM

(ooxml, embedded labels, table is Sheet1);

concatenate

LOAD [case num],

     [Dr 3] as DR,

     [B/N 3] as Answered,

     [B/N] as CorrectAnswer,

     'DR1' as DR_Instance,

          if([B/N 1] = [B/N],1,0) as ResponseFLAG

FROM

(ooxml, embedded labels, table is Sheet1);

For Expression use Sum (ResponseFLAG)

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
petter
Partner - Champion III
Partner - Champion III

Doing the correct transformations in your load script makes it much easier to get exactly what you want in your dashboard:

2017-01-31 18_31_34-Qlik Sense Desktop.png

2017-01-31 18_32_40-Qlik Sense Desktop.png

Not applicable
Author

Thank you Petter!