Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello i need to calculate average of actif car per month :
i used a QVD who stock a field named actif need to historise it everyday to know if the car is actif or not (if this field =1 it will be actif for this date)
in the end of the month i need to calculate the ratio between all car and the actif one per month and this is the QVD used :
// QVD_actif:
// LOAD * FROM
// Concatenate:
// LOAD
// * WHERE "date"= Today()
// ;
// SELECT
car,
actif
date
// FROM Database.table
// ;
// // ////*********store QVD**************
// STORE [QVD_actif] into [$(vQvdPath)\QVD_actif.qvd](qvd);
Zied,
Do something like
count_Actif_1:
Load car,Month(Date) as Month,count(1) as Actif_1
resident <your table>
where actif=1
group by car,Month(Date);
join (count_Actif_1)
Load car,Month(Date) as Month,count(1) as Actif_0
resident <your table>
where actif=0
group by car,Month(Date);
Load car,Month,Actif_1/Actif_0 as ratio
resident count_Actif_1;
Drop table count_Actif_1;
Hope i understood you correctly and it helps you.
yes,just in QVD i need how to stock the field value per day
You need month level ratio to be stored against the date??