Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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?
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;
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);
What are you trying to Count here? You cannot use Count(*), you will have to specify a field name here.
I have to count every record and save it like "rich_totali"
Would you be able to provide 5-10 rows of dummy data and the output you would like to store in the qvd?
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)
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?
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