Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to make a mapping load where i map one datefield, format: YYYY-MM-DD, with 2 fields that represent year and month (number format).
I have tried a couple of differents things, ex:
First mapping: Year(date(Datefield)) & '#' & Num(Month(date(Datefield)))
mapping too: Yearfield & '#' & Monthfield
Does anyone know a solution to my problem?
If you instead of mapping. Just load the two tables. Is there a key that binds them together?
Just load Year(date(Datefield)) & '#' & Num(Month(date(Datefield))) as %YearMonth
And also Yearfield & '#' & Monthfield as %YearMonth
What does it look like then? Please show a screenshots of the vaules in each fields.
Instead of Num if you want numeric value, use floor. Num is great for formatting the text-representation for a number, but I never use it to create a numeric value.
Can you please share the full script
Sure, here it comes:
map_Test:
Mapping load
Yearfield & '#' & Monthfield,
ColumnTest
from $(vPathQvdExtracted)tabell1.qvd (qvd);
applymap('map_Test', Year(date(Datefield)) & '#' & Num(Month(date(Datefield))), 1) as ColumnTest
from $(vPathQvdExtracted)tabell2.qvd (qvd);
If you instead of mapping. Just load the two tables. Is there a key that binds them together?
Just load Year(date(Datefield)) & '#' & Num(Month(date(Datefield))) as %YearMonth
And also Yearfield & '#' & Monthfield as %YearMonth
What does it look like then? Please show a screenshots of the vaules in each fields.
Instead of Num if you want numeric value, use floor. Num is great for formatting the text-representation for a number, but I never use it to create a numeric value.
Thanks for your answer, i think i solved it with your help!
This script did i use in the solution:
applymap('mapKursKoncernvaluta', floor(Year(date(Datefield))) & '#' & floor(Month(date(Datefield))) , 1)
@AndreasMoller Glad to hear I could help you out! 😄
Please mark response as solution if it solved your problem.
Cheers!