Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a question
How can i do a condition on mapping
i.e
i have column called 'Year' in table nad i have column called 'Future' in another table
what i want is to make this mapping
LOAD * Inline
[
Activity,Future
A,004
B,006
C,005
D,000
];
for Year=2009
and to make this mapping
LOAD * Inline
[
Activity,Future
A,003
B,006
B,005
D,004
];
for Year=2010
how can i do that??
So activity and future do only exist in your above two tables and you don't want a static mapping in the load?
What about a table like
LOAD * INLINE[
Year, Activity, Future
2009, A, 004
2010, A, 003
2009, B, 006
2010, B, 006
...
];
This should link your selected year to the appropriate Activity / Future combinations?
Well I think I misses your point, could you explain your data model and your business goal a bit more, please?
Regards,
Stefan
Hi Mona,
I think you could either use one mapping tabel, and combine e.g. Year and Activitiy as YearActivitiy to map, like
MapTableA:
Mapping LOAD * INLINE [
YearActivity, Future
2009A, 004
2010A, 003
2009B, 006
2010B, 006
...
];
and use applymap with a dynamical build YearActivity in the table you want to apply the mapping to,
or
use two mapping tables with distinct table name (MapTable2009, MapTable2010) and use a condition (if() / pick() ) to select the correct mapping table name for applymap.
I haven't tried nested applymaps as third idea (use a map to retrieve the mapping table name from given year), don't know if this works at all.
But first two ideas should work.
Regards,
Stefan
Thanks Stefan,
But how can i combine Year with Activity
Year is a field name in the table How can i combine it with the column i will name??
i want when i select the year i want
the correct mapping to be applied
So activity and future do only exist in your above two tables and you don't want a static mapping in the load?
What about a table like
LOAD * INLINE[
Year, Activity, Future
2009, A, 004
2010, A, 003
2009, B, 006
2010, B, 006
...
];
This should link your selected year to the appropriate Activity / Future combinations?
Well I think I misses your point, could you explain your data model and your business goal a bit more, please?
Regards,
Stefan
Thanks Stefan
i didn't know if there was available to make 3 fields in mapping but now i did know