Hi, I would greatly appreciate it if someone could help me with this calculation.
I want to count the number of dbids based on the report_time column. When report_time is available, I want to count all the dbids, which are lower in value as compared to the current dbid, where resolution_timestamp is greater than the report_time of the current dbid.
Please see the attached picture. I want to calculate the wanted column as shown in the attached picture. The explanation column shows the reasoning behind the values in the wanted column.
Here is the sample data.
Code:
* Example generated by -dataex-. For more info, type help dataex clear input long dbid double(report_time resolution_timestamp) 412735 . 1856208378000 412754 1853220847616 1886187028480 412756 . 1855512505000 412759 . 1854635297000 412772 1853223206912 1886259642368 412781 . 1856191395000 412870 . 1861464751000 412892 . 1853431024000 412896 . 1856198193000 412917 . 1886262361000 412928 . 1862069843000 413075 . 1856209389000 413077 1853310238720 1856180715520 413115 1853324394496 1861570789376 413172 . 1858451505000 413176 . 1858451707000 413184 . 1978148563000 413185 . 1858452263000 413187 . 1976419524000 418248 1854181998592 1886187028480 418262 . 1855797664000 418267 1854186192896 1855405162496 418271 1854186979328 1855835996160 418295 . 1858452544000 418308 1854190780416 1857043431424 418325 . 1855241649000 459739 . 1865615570000 460316 . 1886263053000 478251 . 1874878119000 478315 . 1867087645000 478901 . 1899747510000 479573 . 1911748991000 482340 . 1891113781000 482517 . 1886263515000 482535 . 1867088573000 482645 . 1874874223000 482708 . 1891113724000 487347 . 1886263708000 503988 1867073585152 1909333426176 504122 1867099013120 1867321442304 508726 . 1868228231000 512306 . 1.8702798e+12 519519 . 1870120862000 529233 . 1904244701000 529238 . 1919015047000 530874 . 1874259850000 543775 1871351382016 1874863194112 548212 . 1885756576000 593655 . 1876769490000 633598 . 1878327631000 633976 . 1923158508000 633983 . 1916345555000 634037 . 1911749010000 636643 . 1878311041000 636669 . 1881257594000 667057 . 1880679878000 691804 . 1883923852000 692108 . 1886261391000 692116 1883769929728 1886109827072 707034 . 1916345738000 707052 . 1916346058000 707760 . 1909770916000 710368 1886223073280 1886246797312 710574 . 1887295151000 710878 . 1886990655000 715486 . 1886879398000 715489 . 1886879519000 715581 . 1886879479000 716216 . 1891016872000 716218 . 1887557182000 716219 . 1887557225000 721189 . 1945379232000 721202 . 1916346990000 722145 1887540871168 1889787314176 722281 1887541657600 1890298626048 722292 . 1891186350000 722301 1887544410112 1906138415104 722372 . 1903288101000 723370 . 1906152358000 724878 . 1909277630000 725716 . 1908223670000 725722 . 1908223636000 726586 . 1897157195000 726876 . 1888175564000 729645 . 1906152379000 729648 . 1906152455000 729649 . 1906152487000 729650 . 1906152571000 729652 . 1906152331000 729656 . 1906152034000 729657 . 1906152044000 729669 . 1906151946000 730557 . 1899759508000 751816 . 1899759344000 761671 . 1896720469000 762844 . 1893698642000 770513 1894123044864 1897081995264 770548 1894129467392 1894711033856 770626 . 1896718924000 770746 . 1913046325000 end format %tc report_time format %tc resolution_timestamp
Comment