Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Arrrrrgghhh!
I can't seem to get the Map..Using function to work! I have been trying every single combination, and I'm tearing my hair of.
The applymap works fine, so it can't be a problem with the Mappingtable.
Mappingtable:
Mapping load * inline [
x, y
1, Yes
-1, Yes
0, No
];
map IsPerGroup using Mappingtable;
BudgetFact:
LOAD BudgetFact_id,
BudgetRate,
BudgetQuantity,
BudgetDuration,
BudgetAmount,
Currency as BudgetCurrency,
IsPerGroup,
ProdPackageName,
ProdPackageTypeCode,
ProdPackageTypeName
FROM
[.\DataSources\QVD\BudgetFact.qvd]
(qvd);
I bet someone is going to tell me the answer after 2 min and it is going to be pretty obvious... But any help is very much appreciated.
//Sten
Mappingtable:
Mapping load * inline [
x, y
1, Yes
-1, Yes
0, No
];
map IsPerGroup using Mappingtable;
BudgetFact:
LOAD BudgetFact_id,
BudgetRate,
BudgetQuantity,
BudgetDuration,
BudgetAmount,
Currency as BudgetCurrency,
applymap('Mappingtable', IsPerGroup) as group,
ProdPackageName,
ProdPackageTypeCode,
ProdPackageTypeName
FROM
[.\DataSources\QVD\BudgetFact.qvd]
(qvd);
No, I don't want to use the applymap function since it doesn't work with QVD Optimized loads. I was under the impression that Map..Using would work with QVD optimized as it applies the mapping last, after all QVDs are loaded.
//Sten
Hi,
Applymap function will work in optimized QVD`s as well, at the end of the load statement you need to include WHERE 1 = 1;
Hope this will help you.
-Peterson
Hmm... I tried this now, and it is still not loading (qvd optimized / superfast)... Infact, with the WHERE 1=1 it doens't load QVD optimized even without the ApplyMap-function.
Mappingtable:
Mapping load * inline [
x, y
1, Yes
-1, Yes
0, No
];
BudgetFact:
LOAD BudgetFact_id,
BudgetRate as BudgetRate2,
BudgetQuantity,
BudgetDuration,
BudgetAmount,
Currency as BudgetCurrency,
ApplyMap('MappingTable',IsPerGroup),
ProdPackageName,
ProdPackageTypeCode,
ProdPackageTypeName
FROM
[.\DataSources\QVD\BudgetFact.qvd]
(qvd)
WHERE 1 = 1;
Hi,
I used the below script and got the correct/expected result in the field IsPerGroup
the maybe this is abug related to teh qvd?
BudgetFact:
LOAD * inline [IsPerGroup,TEST
1, Yes
-1, Yes
0, No
];
Hi
Gave it a try too. The manual only states that the mapping table can not be a qvd file but my results show that loading the data from a qvd ignores the map command.
To maintain speed I suggest you build the IsPerGroup value when building the QVD, if you need the original value too add a new field for the mapped representation.
Mappingtable:
Mapping load * inline [
x, y
1, Yes
-1, Yes
0, No
];
//map IsPerGroup using Mappingtable;
BudgetFact:
load * inline [IsPerGroup
0
1
-1
2
-2];
Store BudgetFact INTO BudgetFact.qvd;
DROP TABLE BudgetFact;
map IsPerGroup using Mappingtable;
Load * FROM BudgetFact.qvd (Qvd);
Hi,
I agree I do think the problem is related to the qvd file. I ahev not read the ref manual but my guess/supsicion would be that when a qvd file is read (optimized) the map statement is ignored and no mapping occurs.
I know I'm late to the party, but we only load from QVDs (we pre-build everything). Some of the tricks work sometimes and other times they fail. Not sure, but the manaul says we can't so I gave up trying to find a work-around.
What I do is load the QVD's into a regular QV table, then load the mapping from the resident, then drop the table. An extra step but always works.
Bruce