Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

s_tallhoff
New Contributor

Problem when replacing values in a load script

Hi,

I have a problem. I want to replace the text of 'Answer' to numbers (1,2,3,4) for 6 different questions. The questions all have the same  4 answer alternatives.

This works fine if I only add one of the questions in the load script (see picture 1), then I will get the correct result in my table (see picture 2).

If I add all 6 questions in the loadscript (see picture 3) the table will show strange values (see picture 4). The result is now that each row in the table has now been converted to all numbers (1,2,3,4) and this goes for all 6 questions (I only show one question in the table here).

I would really appreciate your help!

Thank you!

//Sara

7 Replies

Re: Problem when replacing values in a load script

Use as below

NoConcatenate

MasterViews:

Load

  RespondentID,

  QuestionID,

  Answer,

  Pick(Match(Answer,'Agree','Strongly agree','Disagree','Strongly disagree'),2,1,3,4) as MasterNumber

Resident SurveyData

Where Match(QuestionID,34,35,36,37,38,39);

Re: Problem when replacing values in a load script

Could you please share your qvw?

s_tallhoff
New Contributor

Re: Problem when replacing values in a load script

Hi thanks for your help,

Unfortunately this gave the same result (see picture 4).

//Sara

Re: Problem when replacing values in a load script

The problem is related to Data, I need to take a look to your tables to better understand

s_tallhoff
New Contributor

Re: Problem when replacing values in a load script

Hi,

Unfortunately I'm not allowed to send out the file since the appliation contains confidential information.

Is there any other specific information I can give you?

//Sara

Not applicable

Re: Problem when replacing values in a load script

Hi Sara,

you can scramble your data in 'document properties / scrambling'

By match, your cross 2 fields (QuestionId X ResponseId) and get a result like a join would provide

Chris

Re: Problem when replacing values in a load script

If you are worried about data you can use "SCRAMBLE" function but I need to understand other data before you table. send me the script ....