Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Bonjour,
J'aurais besoin de filtrer mes données au moment du chargement des données. Ci-dessous une illustration simple du problème :
Condition : Charger les données pour toutes les valeurs maximums du champ 'VERSION'.
Merci de votre aide précieuse.
Cdt
Ricos
Bonjour,
Source:
LOAD * INLINE [
Produits, version, Prix
A, 1, 100
A, 2, 120
A, 3, 125
B, 1, 200
B, 2, 250
C, 1, 50
];
left join
LOAD Produits,max(version) as maxi Resident Source group by Produits;
NoConcatenate
final :
LOAD * Resident Source where version=maxi;
drop table Source;
drop Field maxi;
This is an example of what to do
AAA:
LOAD * Inline [
A, B, C
a, 1, 111
a, 2, 222
a, 3, 555
b, 1, 222
b, 2, 444
c, 1, 888
];
Left Join
LOAD A, max(B) as maxi Resident AAA Group by A;
Merci mais, le résultat de votre script donne ceci :
or ce que je voulais c'est cela :
Bonjour,
Source:
LOAD * INLINE [
Produits, version, Prix
A, 1, 100
A, 2, 120
A, 3, 125
B, 1, 200
B, 2, 250
C, 1, 50
];
left join
LOAD Produits,max(version) as maxi Resident Source group by Produits;
NoConcatenate
final :
LOAD * Resident Source where version=maxi;
drop table Source;
drop Field maxi;
This is the complete script, but you can use the flag even in the chart, in this way you keep all data.
AAA:
LOAD * Inline [
A, B, C
a, 1, 111
a, 2, 222
a, 3, 555
b, 1, 222
b, 2, 444
c, 1, 888
];
Left Join
LOAD A, max(B) as maxi Resident AAA Group by A;
BBB:
NoConcatenate
LOAD * Resident AAA Where B = maxi;
drop Table AAA;
Ce script répondra à votre demande.
Il est aussi possible de passer directement par une fonction dans qlikview.
Pour cela, il faut utiliser une dimension calculée : =AGGR(max(version),Produits).
Cdt,
Benjamin
Merci beaucoup. C'est exactement çà.
Cdt
Ricos
J'allais justement poser cette question mais vous l'avez anticipé ...
Encore merci
Ricos
Merci beaucoup. Çà marche !
Ricos
Je reviens un peu sur la solution dimension calculée. Quand je fais un TCD avec comme dimension Produits, et Version =AGGR(max(version),Produits) et puis l'expression Prix =sum(Prix), le résultat ne correspond pas à mon attente.
Merci