Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Group by And Delete

Hi,

I need a script that after a load expression, group by the data in a specific way and then delete the loaded data before the group by.

How can I do it?

8 Replies
sunny_talwar

Something like this where you drop the table with the original data?

Table:

LOAD ID,

          Date,

          Sales

FROM Source;

FinalTable:

LOAD Date,

          Sum(Sales)

Resident Table

Group By Date;

DROP Table Table;

Not applicable
Author

I have this situation:

In the log_mahub_sintesi I have all my data. If I try with your answer it wont' works anymore

[log_mahub_sintesi]:

LOAD

  [VERSIONE],

  [RETEACCESSO],

  [ADNETWORK],

  [URL_ADNETWORK],

  [CLI_INDIVIDUATO],

  [MSISDN_INDIVIDUATO],

  [CLUSTER_INDIVIDUATO],

  Year([SIMPLEDATE]) as Year,

  Month([SIMPLEDATE]) as Month,

  [PARTNER]

  count(*) as rich_totali

   

   

FROM  [$(Loadworkpath)log-mahub_0.qvd]

(qvd)

group by

  [VERSIONE],

  [RETEACCESSO],

  [ADNETWORK],

  [URL_ADNETWORK],

  [CLI_INDIVIDUATO],

  [MSISDN_INDIVIDUATO],

  [CLUSTER_INDIVIDUATO],

  [SIMPLEDATE],      

  [PARTNER];

store * from log_mahub_sintesi into [$(Loadworkpath)log.qvd] (qvd);

sunny_talwar

What are you trying to Count here? You cannot use Count(*), you will have to specify a field name here.

Not applicable
Author

I have to count every record and save it like "rich_totali"

sunny_talwar

Would you be able to provide 5-10 rows of dummy data and the output you would like to store in the qvd?

Not applicable
Author

In the "test.csv" there is the data (that I convert in qvd before the groupby).
The result that I need is in the file "log-mahub_Sintesi2.qvd" (this file is the result of the group by aggregation without the deleting phase)

sunny_talwar

Are you looking to get an over total number of row in your database? Is that the goal here? I am still not sure what you want to get from this?

Not applicable
Author

Yes, I'm looking to have a column with the total of rows grouped in the database, because after I have to to a sum over this total of rows