Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Filtrer les données au chargement.

Bonjour,

J'aurais besoin de filtrer mes données au moment du chargement des données. Ci-dessous une illustration simple du problème :

Capture 11.JPG.jpg

Condition : Charger les données pour toutes les valeurs maximums du champ 'VERSION'.

Merci de votre aide précieuse.

Cdt

Ricos

Labels (1)
1 Solution

Accepted Solutions
Not applicable
Author

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;

View solution in original post

9 Replies
alexandros17
Partner - Champion III
Partner - Champion III

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;

Not applicable
Author

Merci mais, le résultat de votre script donne ceci :

Capture 11.JPG.jpg

or ce que je voulais c'est cela :

Capture 11.JPG.jpg

Not applicable
Author

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;

alexandros17
Partner - Champion III
Partner - Champion III

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;

Not applicable
Author

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

Not applicable
Author

Merci beaucoup. C'est exactement çà.

Cdt

Ricos

Not applicable
Author

J'allais justement poser cette question mais vous l'avez anticipé ...

Encore merci

Ricos

Not applicable
Author

Merci beaucoup. Çà marche !

Ricos

Not applicable
Author

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.

Capture 11.JPG.jpg

Merci