Wrap text around rotated table and caption

adjustboxcaptionsrotatingtableswrap

I try to rotate a large table and also the corresponding caption. Around this rotated figure I want to wrap text. I have this MWE, but in this MWE the caption is not rotated and therefore needs a lot of space, so the table isn't readable anymore. I want to give the table as much space as possible.

\documentclass[]{scrbook}

\usepackage{wrapfig}
\usepackage{rotating}

\begin{document}

\subsubsection{QuarterlyTouristsIndia}

\begin{wraptable}{r}{0.25\textwidth}
\centering
\caption{Excerpt of the QuaterlyTouristsIndia dataset.}
\begin{sideways}
\resizebox{\textheight}{!}{%
{\begin{tabular}{lrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr}
    index & \multicolumn{1}{l}{f1} & \multicolumn{1}{l}{f2} & \multicolumn{1}{l}{f3} & \multicolumn{1}{l}{f4} & \multicolumn{1}{l}{f5} & \multicolumn{1}{l}{f6} & \multicolumn{1}{l}{f7} & \multicolumn{1}{l}{f8} & \multicolumn{1}{l}{f9} & \multicolumn{1}{l}{f10} & \multicolumn{1}{l}{f11} & \multicolumn{1}{l}{f12} & \multicolumn{1}{l}{f13} & \multicolumn{1}{l}{f14} & \multicolumn{1}{l}{f15} & \multicolumn{1}{l}{f16} & \multicolumn{1}{l}{f17} & \multicolumn{1}{l}{f18} & \multicolumn{1}{l}{f19} & \multicolumn{1}{l}{f20} & \multicolumn{1}{l}{f21} & \multicolumn{1}{l}{f22} & \multicolumn{1}{l}{f23} & \multicolumn{1}{l}{f24} & \multicolumn{1}{l}{f25} & \multicolumn{1}{l}{f26} & \multicolumn{1}{l}{f27} & \multicolumn{1}{l}{f28} & \multicolumn{1}{l}{f29} & \multicolumn{1}{l}{f30} & \multicolumn{1}{l}{f31} & \multicolumn{1}{l}{f32} & \multicolumn{1}{l}{f33} & \multicolumn{1}{l}{f34} & \multicolumn{1}{l}{f35} & \multicolumn{1}{l}{f36} & \multicolumn{1}{l}{f37} & \multicolumn{1}{l}{f38} & \multicolumn{1}{l}{f39} & \multicolumn{1}{l}{f40} & \multicolumn{1}{l}{f41} & \multicolumn{1}{l}{TouristsIndia} \\
    01.01.2005 & 8338  & 7933  & 1463  & 1932  & 1426  & 676   & 3600  & 1375  & 1287  & 937   & 8738  & 7933  & 1462  & 2004  & 1477  & 689   & 3771  & 1444  & 1287  & 1040  & 13068 & 12547 & 2861  & 2800  & 2030  & 1095  & 5449  & 1984  & 1854  & 1610  & 13824 & 12547 & 2958  & 2913  & 2112  & 1132  & 5754  & 2099  & 1854  & 1801  & 9393  & 1108967 \\
    01.04.2005 & 8641  & 7608  & 1517  & 1994  & 1480  & 699   & 3669  & 1424  & 1289  & 957   & 8224  & 7608  & 1450  & 1960  & 1460  & 694   & 3537  & 1372  & 1289  & 876   & 13455 & 11852 & 2901  & 2861  & 2073  & 1139  & 5588  & 2048  & 1900  & 1639  & 12816 & 11852 & 2778  & 2797  & 2017  & 1126  & 5375  & 1971  & 1900  & 1503  & 6257  & 721024 \\
    01.07.2005 & 8861  & 7670  & 1582  & 2030  & 1516  & 725   & 3787  & 1469  & 1331  & 987   & 8404  & 7670  & 1232  & 1997  & 1498  & 707   & 3739  & 1429  & 1331  & 979   & 13644 & 11730 & 2943  & 2891  & 2110  & 1166  & 5699  & 2091  & 1934  & 1673  & 12861 & 11730 & 2253  & 2827  & 2077  & 1130  & 5608  & 2023  & 1934  & 1650  & 6964  & 838583 \\
    01.10.2005 & 9206  & 8840  & 1654  & 2116  & 1589  & 776   & 3930  & 1533  & 1379  & 1019  & 9592  & 8840  & 2060  & 2104  & 1568  & 782   & 3916  & 1546  & 1379  & 991   & 13990 & 13350 & 2997  & 2970  & 2177  & 1232  & 5843  & 2152  & 1990  & 1701  & 14497 & 13350 & 3702  & 2969  & 2172  & 1238  & 5809  & 2170  & 1990  & 1649  & 10509 & 1250037 \\
    01.01.2006 & 9582  & 9107  & 1699  & 2182  & 1634  & 804   & 4106  & 1594  & 1468  & 1044  & 10069 & 9107  & 1710  & 2262  & 1693  & 821   & 4301  & 1672  & 1468  & 1161  & 14341 & 13793 & 3007  & 3042  & 2230  & 1254  & 6062  & 2222  & 2123  & 1717  & 15256 & 13793 & 3115  & 3170  & 2324  & 1297  & 6399  & 2349  & 2123  & 1927  & 11910 & 1267443 \\
    01.04.2006 & 9877  & 8812  & 1721  & 2320  & 1740  & 837   & 4235  & 1645  & 1521  & 1069  & 9356  & 8812  & 1633  & 2285  & 1720  & 835   & 4107  & 1593  & 1521  & 992   & 14531 & 12956 & 3034  & 3169  & 2326  & 1267  & 6126  & 2252  & 2155  & 1719  & 13765 & 12956 & 2886  & 3106  & 2272  & 1253  & 5928  & 2174  & 2155  & 1599  & 7566  & 853856 \\
    01.07.2006 & 10411 & 8965  & 1788  & 2427  & 1845  & 871   & 4419  & 1745  & 1587  & 1087  & 9866  & 8965  & 1381  & 2380  & 1821  & 851   & 4369  & 1698  & 1587  & 1083  & 14995 & 12877 & 3067  & 3267  & 2411  & 1286  & 6262  & 2343  & 2201  & 1718  & 14178 & 12877 & 2331  & 3185  & 2369  & 1247  & 6173  & 2268  & 2201  & 1704  & 8970  & 929458 \\
\end{tabular}}}
\end{sideways}
\end{wraptable}

This is a multivariate dataset consisting of different configurations of Gross Domestic Product across multiple sectors and Foreign Exchange Earnings as determinants of Foreign Tourism Demand and the number of Foreign Tourist Arrivals in India.
The Foreign Tourist Arrivals are acquired from Indian Tourism Statistics for the duration of 2015-2016.
The Foreign Exchange Earnings are collected from Various Issues of Indian Tourism Statistics, M/o Tourism, Market Research Division in Indian Rupee Crores. One Crore is equal to the number 10,000,000. 
The different GDP values are extracted from the Organisation for Economic Co-Operation and Development in Indian Rupee Billions.
The data contains 41 features which are determinants of Foreign Tourist Arrivals and corresponding Foreign Tourist Arrivals for January-March from 2005 to 2016.
The first 40 features contain information regarding different GDP configurations (in India Rupee Billions), which are further classified in the following categories:

\begin{itemize}
\item CQRSA: National currency, current prices, quarterly levels, seasonally adjusted.
\item CQR: National currency, current prices, quarterly levels.
\item VNBQRSA: National currency, constant prices, national base year, quarterly levels, seasonally adjusted.
\item VNBQR: National currency, constant prices, national base year, quarterly levels.
\end{itemize}

Each of the configurations or GDP categories have their share in multiple sectors and can therefore be divided in sub-categories: 
\begin{itemize}
\item gross domestic product at market prices - output approach
\item gross value added at basic prices 
\item total activity
\item agriculture
\item forestry and fishing 
\item industry
\item including energy
\item manufacturing 
\item construction
\item services
\item distribution trade, repairs, transport, accommodation, food service 
\item real estate activities
\item public administration, education, human health 
\end{itemize}
 
The second to last or 41st feature is the total Foreign Exchange Earnings (in Indian Rupee Crores). The 42nd feature are the foreign tourist arrivals in India. 
The dataset therefore contains 42 columns and 48 rows.
An explanation to each column is shown in table \ref{tab:india}.

\end{document}

Best Answer

Try this solution:

a

\documentclass[]{scrbook}

\usepackage{wrapfig}
%\usepackage{rotating}
\usepackage{adjustbox}

\begin{document}
    
\subsubsection{QuarterlyTouristsIndia}

{\noindent  \begin{wraptable}{r}{0.25\textwidth}
        \centering
\begin{adjustbox}{addcode={\begin{minipage}{\width}}{%
                \caption{\footnotesize  Excerpt of the QuaterlyTouristsIndia dataset.}\label{tab:india}
            \end{minipage}},rotate=90,center}
            \resizebox{\textheight}{!}{%
                {\begin{tabular}{lrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr}
                        index & \multicolumn{1}{l}{f1} & \multicolumn{1}{l}{f2} & \multicolumn{1}{l}{f3} & \multicolumn{1}{l}{f4} & \multicolumn{1}{l}{f5} & \multicolumn{1}{l}{f6} & \multicolumn{1}{l}{f7} & \multicolumn{1}{l}{f8} & \multicolumn{1}{l}{f9} & \multicolumn{1}{l}{f10} & \multicolumn{1}{l}{f11} & \multicolumn{1}{l}{f12} & \multicolumn{1}{l}{f13} & \multicolumn{1}{l}{f14} & \multicolumn{1}{l}{f15} & \multicolumn{1}{l}{f16} & \multicolumn{1}{l}{f17} & \multicolumn{1}{l}{f18} & \multicolumn{1}{l}{f19} & \multicolumn{1}{l}{f20} & \multicolumn{1}{l}{f21} & \multicolumn{1}{l}{f22} & \multicolumn{1}{l}{f23} & \multicolumn{1}{l}{f24} & \multicolumn{1}{l}{f25} & \multicolumn{1}{l}{f26} & \multicolumn{1}{l}{f27} & \multicolumn{1}{l}{f28} & \multicolumn{1}{l}{f29} & \multicolumn{1}{l}{f30} & \multicolumn{1}{l}{f31} & \multicolumn{1}{l}{f32} & \multicolumn{1}{l}{f33} & \multicolumn{1}{l}{f34} & \multicolumn{1}{l}{f35} & \multicolumn{1}{l}{f36} & \multicolumn{1}{l}{f37} & \multicolumn{1}{l}{f38} & \multicolumn{1}{l}{f39} & \multicolumn{1}{l}{f40} & \multicolumn{1}{l}{f41} & \multicolumn{1}{l}{TouristsIndia} \\
                        01.01.2005 & 8338  & 7933  & 1463  & 1932  & 1426  & 676   & 3600  & 1375  & 1287  & 937   & 8738  & 7933  & 1462  & 2004  & 1477  & 689   & 3771  & 1444  & 1287  & 1040  & 13068 & 12547 & 2861  & 2800  & 2030  & 1095  & 5449  & 1984  & 1854  & 1610  & 13824 & 12547 & 2958  & 2913  & 2112  & 1132  & 5754  & 2099  & 1854  & 1801  & 9393  & 1108967 \\
                        01.04.2005 & 8641  & 7608  & 1517  & 1994  & 1480  & 699   & 3669  & 1424  & 1289  & 957   & 8224  & 7608  & 1450  & 1960  & 1460  & 694   & 3537  & 1372  & 1289  & 876   & 13455 & 11852 & 2901  & 2861  & 2073  & 1139  & 5588  & 2048  & 1900  & 1639  & 12816 & 11852 & 2778  & 2797  & 2017  & 1126  & 5375  & 1971  & 1900  & 1503  & 6257  & 721024 \\
                        01.07.2005 & 8861  & 7670  & 1582  & 2030  & 1516  & 725   & 3787  & 1469  & 1331  & 987   & 8404  & 7670  & 1232  & 1997  & 1498  & 707   & 3739  & 1429  & 1331  & 979   & 13644 & 11730 & 2943  & 2891  & 2110  & 1166  & 5699  & 2091  & 1934  & 1673  & 12861 & 11730 & 2253  & 2827  & 2077  & 1130  & 5608  & 2023  & 1934  & 1650  & 6964  & 838583 \\
                        01.10.2005 & 9206  & 8840  & 1654  & 2116  & 1589  & 776   & 3930  & 1533  & 1379  & 1019  & 9592  & 8840  & 2060  & 2104  & 1568  & 782   & 3916  & 1546  & 1379  & 991   & 13990 & 13350 & 2997  & 2970  & 2177  & 1232  & 5843  & 2152  & 1990  & 1701  & 14497 & 13350 & 3702  & 2969  & 2172  & 1238  & 5809  & 2170  & 1990  & 1649  & 10509 & 1250037 \\
                        01.01.2006 & 9582  & 9107  & 1699  & 2182  & 1634  & 804   & 4106  & 1594  & 1468  & 1044  & 10069 & 9107  & 1710  & 2262  & 1693  & 821   & 4301  & 1672  & 1468  & 1161  & 14341 & 13793 & 3007  & 3042  & 2230  & 1254  & 6062  & 2222  & 2123  & 1717  & 15256 & 13793 & 3115  & 3170  & 2324  & 1297  & 6399  & 2349  & 2123  & 1927  & 11910 & 1267443 \\
                        01.04.2006 & 9877  & 8812  & 1721  & 2320  & 1740  & 837   & 4235  & 1645  & 1521  & 1069  & 9356  & 8812  & 1633  & 2285  & 1720  & 835   & 4107  & 1593  & 1521  & 992   & 14531 & 12956 & 3034  & 3169  & 2326  & 1267  & 6126  & 2252  & 2155  & 1719  & 13765 & 12956 & 2886  & 3106  & 2272  & 1253  & 5928  & 2174  & 2155  & 1599  & 7566  & 853856 \\
                        01.07.2006 & 10411 & 8965  & 1788  & 2427  & 1845  & 871   & 4419  & 1745  & 1587  & 1087  & 9866  & 8965  & 1381  & 2380  & 1821  & 851   & 4369  & 1698  & 1587  & 1083  & 14995 & 12877 & 3067  & 3267  & 2411  & 1286  & 6262  & 2343  & 2201  & 1718  & 14178 & 12877 & 2331  & 3185  & 2369  & 1247  & 6173  & 2268  & 2201  & 1704  & 8970  & 929458 \\
            \end{tabular}}}
     \end{adjustbox}
    \end{wraptable}
    
    This is a multivariate dataset consisting of different configurations of Gross Domestic Product across multiple sectors and Foreign Exchange Earnings as determinants of Foreign Tourism Demand and the number of Foreign Tourist Arrivals in India.
    The Foreign Tourist Arrivals are acquired from Indian Tourism Statistics for the duration of 2015-2016.
    The Foreign Exchange Earnings are collected from Various Issues of Indian Tourism Statistics, M/o Tourism, Market Research Division in Indian Rupee Crores. One Crore is equal to the number 10,000,000. 
    The different GDP values are extracted from the Organisation for Economic Co-Operation and Development in Indian Rupee Billions.
    The data contains 41 features which are determinants of Foreign Tourist Arrivals and corresponding Foreign Tourist Arrivals for January-March from 2005 to 2016.
    The first 40 features contain information regarding different GDP configurations (in India Rupee Billions), which are further classified in the following categories:
    
    \begin{itemize}
        \item CQRSA: National currency, current prices, quarterly levels, seasonally adjusted.
        \item CQR: National currency, current prices, quarterly levels.
        \item VNBQRSA: National currency, constant prices, national base year, quarterly levels, seasonally adjusted.
        \item VNBQR: National currency, constant prices, national base year, quarterly levels.
    \end{itemize}
    
    Each of the configurations or GDP categories have their share in multiple sectors and can therefore be divided in sub-categories: 
    \begin{itemize}
        \item gross domestic product at market prices - output approach
        \item gross value added at basic prices 
        \item total activity
        \item agriculture
        \item forestry and fishing 
        \item industry
        \item including energy
        \item manufacturing 
        \item construction
        \item services
        \item distribution trade, repairs, transport, accommodation, food service 
        \item real estate activities
        \item public administration, education, human health 
    \end{itemize}
} % end wrap <<<<<<<<<
    
    The second to last or 41st feature is the total Foreign Exchange Earnings (in Indian Rupee Crores). The 42nd feature are the foreign tourist arrivals in India. 
    The dataset therefore contains 42 columns and 48 rows.
    An explanation to each column is shown in table \ref{tab:india}.
    
\end{document}

From rotate floats with captions

UPDATE

To have the caption above the table use

{\noindent  \begin{wraptable}{r}{0.20\textwidth}
        \centering
\begin{adjustbox}{addcode={\begin{minipage}{\width}\caption{\footnotesize   Excerpt of the QuaterlyTouristsIndia dataset.}\label{tab:india}}{\end{minipage}},rotate=90,center}
            \resizebox{\textheight}{!}{%

b

Related Question