Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Export Error

    Hi all I am trying to export the data from Stata to Excel but getting the following error message

    observations must be between 1 and 1048576.


    any solution, please

    and how I can restrict the data while doing the export based on the date.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input double(LATNUM_temp LONGNUM_temp) int year float(month date) long temp_ID double(temp precip Sum) float temp_c
     71.25 -179.75 1998 1 456   1 -25.5   2.9  139.9 -31.944445
     68.75 -179.75 1998 1 456   2 -28.8   8.3    328  -33.77778
     68.25 -179.75 1998 1 456   3 -29.4  10.9  339.9  -34.11111
     67.75 -179.75 1998 1 456   4   -28  15.5  401.4 -33.333332
     67.25 -179.75 1998 1 456   5 -29.8  20.3  500.3 -34.333332
     66.75 -179.75 1998 1 456   6 -25.7  15.2  594.8 -32.055557
     66.25 -179.75 1998 1 456   7 -21.3   8.3  659.3  -29.61111
     65.75 -179.75 1998 1 456   8 -21.1  13.1  579.3      -29.5
     65.25 -179.75 1998 1 456   9 -22.1  20.7  544.3 -30.055555
    -16.75 -179.75 1998 1 456  10  27.8 373.9 1951.3 -2.3333333
    -84.75 -179.75 1998 1 456  11 -19.7   9.4     98  -28.72222
    -85.25 -179.75 1998 1 456  12 -24.7   6.8     67      -31.5
    -85.75 -179.75 1998 1 456  13 -23.6   4.9   45.1  -30.88889
    -86.25 -179.75 1998 1 456  14   -25   3.5   31.3 -31.666666
    -86.75 -179.75 1998 1 456  15 -26.2   2.6   21.5 -32.333332
    -87.25 -179.75 1998 1 456  16 -26.9   1.7   12.3  -32.72222
    -87.75 -179.75 1998 1 456  17 -27.3    .8    3.1 -32.944443
    -88.25 -179.75 1998 1 456  18 -27.9    .3     .5  -33.27778
    -88.75 -179.75 1998 1 456  19 -27.9    .1     .3  -33.27778
    -89.25 -179.75 1998 1 456  20 -27.6     0     .1  -33.11111
    -89.75 -179.75 1998 1 456  21 -27.1     0      0 -32.833332
     71.25 -179.25 1998 1 456  22 -25.8   2.6  137.1  -32.11111
     68.75 -179.25 1998 1 456  23 -27.6   6.7  320.8  -33.11111
     68.25 -179.25 1998 1 456  24 -29.4    11  339.3  -34.11111
     67.75 -179.25 1998 1 456  25   -29  16.3    400  -33.88889
     67.25 -179.25 1998 1 456  26 -28.2  22.2  503.1 -33.444443
     66.75 -179.25 1998 1 456  27 -27.2  16.9    608  -32.88889
    -84.75 -179.25 1998 1 456  28 -18.7   9.3     98 -28.166666
    -85.25 -179.25 1998 1 456  29 -24.6   6.8     67 -31.444445
    -85.75 -179.25 1998 1 456  30 -23.4   4.8     45  -30.77778
    -86.25 -179.25 1998 1 456  31   -25   3.6   31.6 -31.666666
    -86.75 -179.25 1998 1 456  32 -26.1   2.6   21.5  -32.27778
    -87.25 -179.25 1998 1 456  33 -26.8   1.7   12.4 -32.666668
    -87.75 -179.25 1998 1 456  34 -27.3    .8    3.1 -32.944443
    -88.25 -179.25 1998 1 456  35 -27.9    .3     .5  -33.27778
    -88.75 -179.25 1998 1 456  36 -27.9    .1     .3  -33.27778
    -89.25 -179.25 1998 1 456  37 -27.5     0     .1 -33.055557
    -89.75 -179.25 1998 1 456  38 -27.1     0      0 -32.833332
     71.25 -178.75 1998 1 456  39 -25.5   2.6  138.5 -31.944445
     68.25 -178.75 1998 1 456  40 -27.4  11.3  334.6        -33
     67.75 -178.75 1998 1 456  41 -27.5  16.6  390.9 -33.055557
     67.25 -178.75 1998 1 456  42 -26.8  22.6  494.9 -32.666668
     66.75 -178.75 1998 1 456  43 -27.9  17.9    600  -33.27778
     66.25 -178.75 1998 1 456  44 -21.9  10.6  673.6 -29.944445
    -84.75 -178.75 1998 1 456  45 -21.1   9.4   99.1      -29.5
    -85.25 -178.75 1998 1 456  46 -24.1   6.7   66.8 -31.166666
    -85.75 -178.75 1998 1 456  47 -23.2   4.8   45.1 -30.666666
    -86.25 -178.75 1998 1 456  48   -25   3.6   31.6 -31.666666
    -86.75 -178.75 1998 1 456  49 -26.1   2.6   21.6  -32.27778
    -87.25 -178.75 1998 1 456  50 -26.8   1.6   12.3 -32.666668
    -87.75 -178.75 1998 1 456  51 -27.2    .8    3.2  -32.88889
    -88.25 -178.75 1998 1 456  52 -27.9    .3     .5  -33.27778
    -88.75 -178.75 1998 1 456  53 -27.9    .1     .3  -33.27778
    -89.25 -178.75 1998 1 456  54 -27.5     0     .1 -33.055557
    -89.75 -178.75 1998 1 456  55 -27.1     0      0 -32.833332
     71.25 -178.25 1998 1 456  56 -25.6   2.7  141.9        -32
     68.25 -178.25 1998 1 456  57 -28.1  11.5  322.7  -33.38889
     67.75 -178.25 1998 1 456  58 -26.6    16    370 -32.555557
     67.25 -178.25 1998 1 456  59 -27.9  21.1  468.7  -33.27778
     66.75 -178.25 1998 1 456  60 -28.1  17.9  578.6  -33.38889
     66.25 -178.25 1998 1 456  61 -21.3  12.7  639.5  -29.61111
     65.75 -178.25 1998 1 456  62 -21.5  14.9  601.2  -29.72222
    -84.75 -178.25 1998 1 456  63 -21.2   9.4   99.4 -29.555555
    -85.25 -178.25 1998 1 456  64 -22.1   6.7   66.8 -30.055555
    -85.75 -178.25 1998 1 456  65 -23.1   4.8   45.1  -30.61111
    -86.25 -178.25 1998 1 456  66 -24.9   3.6   31.6  -31.61111
    -86.75 -178.25 1998 1 456  67   -26   2.6   21.6  -32.22222
    -87.25 -178.25 1998 1 456  68 -26.8   1.6   12.5 -32.666668
    -87.75 -178.25 1998 1 456  69 -27.2    .8    3.3  -32.88889
    -88.25 -178.25 1998 1 456  70 -27.9    .3     .5  -33.27778
    -88.75 -178.25 1998 1 456  71 -27.9    .1     .3  -33.27778
    -89.25 -178.25 1998 1 456  72 -27.5     0     .1 -33.055557
    -89.75 -178.25 1998 1 456  73 -27.1     0      0 -32.833332
     71.25 -177.75 1998 1 456  74 -24.7   2.5  146.5      -31.5
     68.25 -177.75 1998 1 456  75 -26.9  11.3  304.6  -32.72222
     67.75 -177.75 1998 1 456  76 -26.9  14.9    336  -32.72222
     67.25 -177.75 1998 1 456  77 -26.3  19.1    437  -32.38889
     66.75 -177.75 1998 1 456  78 -27.7  17.6    548 -33.166668
     66.25 -177.75 1998 1 456  79 -23.6  14.5  606.7  -30.88889
     65.75 -177.75 1998 1 456  80 -22.6  16.1  610.5 -30.333334
    -84.75 -177.75 1998 1 456  81 -20.3   9.4   99.5 -29.055555
    -85.25 -177.75 1998 1 456  82 -20.1   6.7   66.8 -28.944445
    -85.75 -177.75 1998 1 456  83   -23   4.8   45.1 -30.555555
    -86.25 -177.75 1998 1 456  84 -24.7   3.6   31.7      -31.5
    -86.75 -177.75 1998 1 456  85   -26   2.6   21.6  -32.22222
    -87.25 -177.75 1998 1 456  86 -26.7   1.7   12.8  -32.61111
    -87.75 -177.75 1998 1 456  87 -27.2    .8    3.4  -32.88889
    -88.25 -177.75 1998 1 456  88 -27.9    .3     .5  -33.27778
    -88.75 -177.75 1998 1 456  89 -27.9    .1     .3  -33.27778
    -89.25 -177.75 1998 1 456  90 -27.5     0     .1 -33.055557
    -89.75 -177.75 1998 1 456  91 -27.1     0      0 -32.833332
     67.75 -177.25 1998 1 456  92 -26.5  13.1  291.1      -32.5
     67.25 -177.25 1998 1 456  93 -26.1  16.9  393.8  -32.27778
     66.75 -177.25 1998 1 456  94   -25  17.7  513.1 -31.666666
     66.25 -177.25 1998 1 456  95 -24.8  15.7  584.4 -31.555555
     65.75 -177.25 1998 1 456  96 -22.6  17.6  622.2 -30.333334
     51.75 -177.25 1998 1 456  97   -.4  79.4 1260.4        -18
    -84.75 -177.25 1998 1 456  98 -18.7   9.3   99.5 -28.166666
    -85.25 -177.25 1998 1 456  99 -18.5   6.8   67.6 -28.055555
    -85.75 -177.25 1998 1 456 100 -23.1   4.8   45.1  -30.61111
    end
    format %tm date

  • #2
    Hi all I am trying to export the data from Stata to Excel but getting the following error message

    observations must be between 1 and 1048576.
    At https://support.microsoft.com/en-us/...7-269d656771c3 Microsoft tells us that the maximum limits for contemporary versions of Excel are

    Total number of rows and columns on a worksheet
    1,048,576 rows by 16,384 columns
    so there is no solution other than to export fewer observations.

    how I can restrict the data while doing the export based on the date
    The output of help export excel tells us that you can use the if clause on export excel. Your variable date is a monthly value, and the output of help datetime (in the final section) tells us that the tm() function is a convenient way to create a monthly date constant in an expression. Putting this together
    Code:
    export excel if date<tm(2000m1)
    will export all your observations from before January 2000.

    Comment

    Working...
    X