How to find total days ,weeks , months and Quarter in total data

how to find total days ,weeks , months and Quarter in total data ?

this what I did , is it correct ?

TimeFrameSet(inDaily);
Newdays = Day()!=Ref(Day(),-1);
Total_Days = Cum(Newdays);
TimeFrameRestore();

TimeFrameSet(inWeekly);
NewWeek = Day()!=Ref(Day(),-1);
Total_Weeks = Cum(NewWeek);
TimeFrameRestore();

TimeFrameSet(inMonthly);
 NewMonths = Day()!=Ref(Day(),-1);
Total_Months = Cum(NewMonths );
TimeFrameRestore();

TimeFrameSet(inQuarterly);
 NewQuarter = Day()!=Ref(Day(),-1);
 Total_Quarters = Cum(NewQuarter );
TimeFrameRestore();


Filter = 1 ;
AddColumn ( Total_Days , " Total_Days "  , 1.2) ;
AddColumn ( Total_Weeks , " Total_Weeks "  , 1.2) ;
AddColumn ( Total_Months , " Total_Month "  , 1.2) ;
AddColumn ( Total_Quarters , " Total_Quarters "  , 1.2) ;

thank you for your help

This topic was automatically closed 100 days after the last reply. New replies are no longer allowed.