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

number of items added

Hello

I have 2 Table , tab 1 & tab 2 i load this elements and i create a qvd file after

I Concatante table 1 & table 2  , so what i want to do , is show the numbers of the new items added

Thank U

/*Signalitique_reference:

LOAD

  @1 as [ref matricule],

  @2 as [ref id ss],

     @6 as [ref nom],

  @7 as [ref prenom],

  '$(ProcessTime)' as [ref Créé le]

FROM [$(FilePath)\data\Signalitique PS\24 - SIGNALETIQUE GROUPE*.xls]

(biff, no labels);

Signalitique_reference:

LOAD

  [ref matricule],

  [ref id ss],

     [ref nom],

  [ref prenom],

  [ref Créé le]

FROM $(FilePath)\QV_Dev\Signalitique_reference.QVD (qvd);

RefSign:

NOCONCATENATE

LOAD

  @1 as [ref matricule],

  @2 as [ref id ss],

     @6 as [ref nom],

  @7 as [ref prenom],

  '$(ProcessTime)' as [ref Créé le]

FROM [$(FilePath)\data\Signalitique PS\24 - SIGNALETIQUE GROUPE*.xls]

(biff, no labels);

STORE RefSign INTO $(FilePath)\QV_Dev\RefSign.QVD;

drop table RefSign ;

CONCATENATE (Signalitique_reference) LOAD Distinct

  *

FROM $(FilePath)\QV_Dev\RefSign.QVD (qvd)

WHERE NOT Exists([ref matricule]);

STORE Signalitique_reference INTO $(FilePath)\Dev\Signalitique_reference.QVD;

STORE Signalitique_reference INTO $(FilePath)\QV_Dev\Signalitique_reference.QVD;*/

1 Solution

Accepted Solutions
Not applicable
Author

7 Replies
jchoucq
Partner - Creator III
Partner - Creator III

Hi,

do you mean, you want to know the number of records of you xls file ?

maby you can add a counter column  in order to make a sum on it ?

  1. /*Signalitique_reference: 
  2. LOAD 
  3.   @1 as [ref matricule], 
  4.   @2 as [ref id ss], 
  5.      @6 as [ref nom], 
  6.   @7 as [ref prenom], 
  7.   '$(ProcessTime)' as [ref Créé le]  ,
  8.   1 as Counter
  9. FROM [$(FilePath)\data\Signalitique PS\24 - SIGNALETIQUE GROUPE*.xls] 
  10. (biff, no labels); 
  11.  
  12.  
  13. Signalitique_reference: 
  14. LOAD 
  15.   [ref matricule], 
  16.   [ref id ss], 
  17.      [ref nom], 
  18.   [ref prenom], 
  19.   [ref Créé le] 
  20.   0 as Counter
  21. FROM $(FilePath)\QV_Dev\Signalitique_reference.QVD (qvd); 


Regards

Johann

Not applicable
Author

Bonjour Johanne

ce que je veux faire , c'est afficher juste le nombre des nouveaux éléments qui ont étaient ajouté a ma table ( ex : un message pour me dire , 3 client ont éte ajoutés ) , ca me permets de checker , le nombre des nouveaux clients ajoutés a ma table .

jchoucq
Partner - Creator III
Partner - Creator III

où le message doit il s'afficher ?

Dans l'application, il suffira de faire Sum(Counter) pour avoir le nombre de lignes ajoutées ?

si c'est dans le script de chargement, il sera possible de faire la somme sur la table (Resident) de mettre la valeur dans une variable et d'utiliser un ordre TRACE.

Cordialement,

Johann

Not applicable
Author

C'est plutot dans un text object dans l'application

Comment on pourrais utiliser Sum(counter) ?? je ne  comprends pas trop , quand je fais ca , il m'affiche 0

Gysbert_Wassenaar

Maybe like this if all you want is the number of new records:

LET vOldRecords = QvdNoOfRecords('$(FilePath)\QV_Dev\Signalitique_reference.QVD');


CONCATENATE (Signalitique_reference)

LOAD Distinct  *

FROM $(FilePath)\QV_Dev\RefSign.QVD (qvd) 

WHERE NOT Exists([ref matricule]); 


LET vNewRecords = NoOfRows('Signalitique_reference') - $(vOldRecords);



Or use another field to denote the new records. You don't load it from the Signalitique_reference.QVD file, but only fill it in the concatenate load:


CONCATENATE (Signalitique_reference)

LOAD Distinct 

[ref matricule],  [ref id ss],  [ref nom],  [ref prenom],  [ref Créé le] ,

1 as IsNew

FROM $(FilePath)\QV_Dev\RefSign.QVD (qvd) 

WHERE NOT Exists([ref matricule]); 


talk is cheap, supply exceeds demand
Not applicable
Author

Hello Wassenaar

it dosent work =(   (LET vNewRecords = NowOfRows('Signalitique_reference') - $(vOldRecords); // )

lET vOldRecords = QvdNoOfRecords('$(FilePath)\QV_Dev\Signalitique_reference.QVD');

CONCATENATE (Signalitique_reference) LOAD Distinct

  *

FROM $(FilePath)\QV_Dev\RefSign.QVD (qvd)

WHERE NOT Exists([ref matricule]);

LET vNewRecords = NowOfRows('Signalitique_reference') - $(vOldRecords); //

STORE Signalitique_reference INTO $(FilePath)\Dev\Signalitique_reference.QVD;

Can i generate a alert message  in a message box , for example : 2 items are be added in your table

Not applicable
Author

NoOfRows !!!!