
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Creating New Field in Data Load Editor
Hello Everyone,
I would like your help.
I have some sample data which is very simple, it looks like so:
Name | Question | Answer |
Person 1 | Question 1 | 1 |
Person 2 | Question 1 | 2 |
Person 1 | Question 2 | 1 |
Person 2 | Question 2 | 2 |
Person 3 | Question 1 | 2 |
Person 3 | Question 2 | 2 |
In the data load editor, I want to make a new field called 'Result' which has two field values 'False' and 'Correct'.
I have tried to do so in the Data Load Editor using this script:
CONCATENATE
[Result]:
LOAD
if([Question]='Question 1' AND [Answer]='1', 'Correct',
if([Question]='Question 1' AND [Answer]='2', 'False',
if([Question]='Question 2' AND [Answer]='1', 'False',
if([Question]='Question 2' AND [Answer]='2', 'Correct'))))
as [Result]
This, however, does not work.
In the data model viewer, the result is this:
Correct and False are found in a field called Result, but they don't have a relationship with the other fields.
What can I do to solve this.
Thank you all in advance,
Alison
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or just create this in the same table...
TableName:
LOAD Name,
Question,
Anwser,
if([Question]='Question 1' AND [Answer]='1', 'Correct',
if([Question]='Question 1' AND [Answer]='2', 'False',
if([Question]='Question 2' AND [Answer]='1', 'False',
if([Question]='Question 2' AND [Answer]='2', 'Correct'))))
as [Result]
FROM ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May be Join the result back, instead of concatenate
Left Join
LOAD Name,
Question,
Anwser,
if([Question]='Question 1' AND [Answer]='1', 'Correct',
if([Question]='Question 1' AND [Answer]='2', 'False',
if([Question]='Question 2' AND [Answer]='1', 'False',
if([Question]='Question 2' AND [Answer]='2', 'Correct'))))
as [Result]
Resident ....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Or just create this in the same table...
TableName:
LOAD Name,
Question,
Anwser,
if([Question]='Question 1' AND [Answer]='1', 'Correct',
if([Question]='Question 1' AND [Answer]='2', 'False',
if([Question]='Question 2' AND [Answer]='1', 'False',
if([Question]='Question 2' AND [Answer]='2', 'Correct'))))
as [Result]
FROM ...

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yeah, that one's right, thanks a lot

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am having a similar situation but here I do not have the result column, I need to create this freshly in the load script. Since I do not have the result column can I still use below condition or should I create this field in the script, if yes, how to create it
if([Question]='Question 1' AND [Answer]='1', 'Correct',
if([Question]='Question 1' AND [Answer]='2', 'False',
if([Question]='Question 2' AND [Answer]='1', 'False',
if([Question]='Question 2' AND [Answer]='2', 'Correct'))))
as [Result]
