Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
bonjour la communité
j'ai un probleme avec generic fonction
mes données sont organiser comme suit :
LOAD
cd_composant,
dt_tx_pbp_def
FROM bi.[ref_manuel]
where cd_composant <> ''
;
les données :
cd_composant, dt_tx_pbp_def
Man_depart , AIN
Man_depart , AIN
Man_depart , Allier
Man_depart , Alpes
Man_CD,Gain
Man_CD,Perdu
Man_CD,Total
Man_Region,Avre
Man_Region,Rhone
....................
ce que je veux faire c'est de transformer cette table en plusieurs tables celon le champs cd_composant donc
une table Man_depart avec un champs Man_depart_dt_tx_pbp_def qui contient [AIN ,Allier,Alpes]
une autre Man_CD ,Man_Region
et Merci d'avance pour votre aide
Bonjour,
tu pourrais procéder en plusieurs étapes de load :
Man_depart :
LOAD
cd_composant,
dt_tx_pbp_def as Man_depart_dt_tx_pbp_def
FROM bi.[ref_manuel]
where cd_composant = 'Man_depart';
etc
cdt
merci olivier pour votre réponse
mais c'été un exemple seulement ma table contien plus que 120 distinct cd_composant
donc il faut utiliser un script automatique
pourrais tu fournir un échantillon sous excel d'une vingtaine de lignes avec 3,4 cd composant stp ?
cd_composant | dt_tx_pbp_def | crunch_date |
MAN_CD_GAIN | Perdu | 20180103 |
MAN_CD_GAIN | Gain Normal | 20180103 |
MAN_CD_GAIN | Remboursement Total | 20180103 |
MAN_SPOT | non Spot | 20180103 |
MAN_SPOT | Spot | 20180103 |
MAN_SPOT | Spot Semi-automatique | 20180103 |
MAN_DEPART | Ain | 20180103 |
MAN_DEPART | Aisne | 20180103 |
MAN_DEPART | Allier | 20180103 |
MAN_DEPART | Alpes de Haute-Provence | 20180103 |
MAN_DEPART | Hautes alpes | 20180103 |
MAN_DEPART | Alpes-Maritimes | 20180103 |
MAN_DEPART | Ardèche | 20180103 |
MAN_DEPART | Ardennes | 20180103 |
MAN_DEPART | Ariège | 20180103 |
MAN_DEPART | Aube | 20180103 |
MAN_DEPART | Aude | 20180103 |
MAN_DEPART | Aveyron | 20180103 |
MAN_DEPART | Bouches-du-Rhône | 20180103 |
MAN_DEPART | Calvados | 20180103 |
MAN_DEPART | Cantal | 20180103 |
MAN_DEPART | Charente | 20180103 |
MAN_DEPART | Charente-Maritime | 20180103 |
MAN_DEPART | Cher | 20180103 |
MAN_DEPART | Corrèze | 20180103 |
MAN_DEPART | Côte-d'Or | 20180103 |
MAN_DEPART | Côtes-d'Armor | 20180103 |
MAN_DEPART | Creuse | 20180103 |
MAN_DEPART | Dordogne | 20180103 |
MAN_DEPART | Doubs | 20180103 |
MAN_DEPART | Drôme | 20180103 |
MAN_DEPART | Eure | 20180103 |
MAN_DEPART | Eure-et-Loir | 20180103 |
MAN_DEPART | Finistère | 20180103 |
MAN_DEPART | Corse du Sud | 20180103 |
MAN_DEPART | Haute-Corse | 20180103 |
MAN_DEPART | Gard | 20180103 |
MAN_DEPART | Haute-Garonne | 20180103 |
MAN_DEPART | Gers | 20180103 |
MAN_DEPART | Gironde | 20180103 |
MAN_DEPART | Herault | 20180103 |
MAN_DEPART | Ille-et-Vilaine | 20180103 |
MAN_DEPART | Indre | 20180103 |
MAN_DEPART | Indre-et-Loire | 20180103 |
MAN_DEPART | Isère | 20180103 |
MAN_DEPART | Jura | 20180103 |
MAN_DEPART | Landes | 20180103 |
thank you for data,
data loaded in table test, then :
cd_composant:
load distinct cd_composant resident test;
for i = 0 to NoOfRows('cd_composant')-1
vcd = peek('cd_composant',i,'cd_composant');
$(vcd):
load cd_composant,dt_tx_pbp_def as dt_tx_pbp_def$(vcd)
resident test where cd_composant = '$(vcd)';
next i;
that gives a table for each cd_composant
Bonjour,
c'est bien ce que tu souhaitais ?
Bonjour,
le script correspond il bien à ce que tu souhaitais ?
merci