Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have 2 excel sheets:
1. This is a list of all entities
ID | Values |
---|---|
1 | A |
2 | B |
3 | C |
4 | D |
2. This is a subset of entities
Values |
---|
A |
C |
D |
I want to map the values from list 2 which is a subset of 1 as 'MAPPED' and all the unmapped values as 'UNMAPPED'. So A, C and D should be mapped as 'MAPPED' and B should be mapped as 'UNMAPPED'
How can I do this in QV?
MappedValues:
load * inline [
Values
A
B
D
];
MyData:
load ID, Values_new, if(exists('Values',Values_new),'MAPPED','UNMAPPED') as IsMapped
from ...somewhere...;
Like this for example:
MappedValues:
load * inline [
Values
A
B
D
];
MyData:
load ID, Values, if(exists(Values),'MAPPED','UNMAPPED') as IsMapped
from ...somewhere...;
The inline load is just an example. You can replace it with some other load statement that loads the mapped values into a field named Values.
I am a little confused here. Let me change the table once. Both table having the same column name is the confusion so changing the name of the first tables column.
ID | Values_new |
---|---|
1 | A |
2 | B |
3 | C |
4 | D |
What should be the syntax now?
MappedValues:
load * inline [
Values
A
B
D
];
MyData:
load ID, Values_new, if(exists('Values',Values_new),'MAPPED','UNMAPPED') as IsMapped
from ...somewhere...;