<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Pivot-table with minimum in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738573#M230414</link>
    <description>Thank you, with your advices it finally worked.</description>
    <pubDate>Mon, 03 May 2021 12:55:14 GMT</pubDate>
    <dc:creator>jo_pariseau</dc:creator>
    <dc:date>2021-05-03T12:55:14Z</dc:date>
    <item>
      <title>Pivot-table with minimum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738066#M230163</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I have a table that looks like this :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;data work.hotel;
Length Hotel_Name $9 Class $1 ;
INPUT Hotel_Name $ Class $ Country $ PRICE ;
CARDS ;
Appolpon A Greece 390
Caravel B Greece 468
Christina A Greece 427
Economy B Greece 369
EdenBeach A Greece 499
HanikianBeach C Greece 526
MarinaBeach C Greece 587
Xenia C Greece 534
Agdal B Maroc 447
Almohades B Maroc 482
Atlas A Maroc 511
AtlasArnadi C Maroc 532
Chems C Maroc 450
Dunes A Maroc 569
AlfaMa B Portu 646
AppDo B Portu 652
DELagos C Portu 802
Madeira A Portu 761
Reid's A Portu 1101
AbouSofiane A Tunis 434
Asdrubal A Tunis 489
Colombes B Tunis 436
Darnaour B Tunis 399
Djerba C Tunis 477
Mimosa C Tunis 375
Omarit B Tunis 486
;
run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I'm trying to create a table with the countries as rows, the class as column and the name of the hotel with the minimum price for each pair.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Something like this :&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;        A           B           C
Greece  Appolpon    Caravel     Marinabeach
Portu   Madeira     Appdo       Delagos
Maroc   Atlas       Agdal       Chems&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I tried with proc tabulate and proc transpose but couldn't get exactly the result i'm looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 01:12:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738066#M230163</guid>
      <dc:creator>jo_pariseau</dc:creator>
      <dc:date>2021-04-30T01:12:48Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot-table with minimum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738073#M230167</link>
      <description>&lt;P&gt;Take the top record first and then try your transpose.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Sort by Country, class, price&lt;/LI&gt;
&lt;LI&gt;Sort by Country, Class - NODUPKEY which will keep the top record&lt;/LI&gt;
&lt;LI&gt;Use PROC TRANSPOSE to flip it wide.&amp;nbsp;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;BR /&gt;Long to Wide:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/363334"&gt;@jo_pariseau&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;SPAN&gt;I have a table that looks like this :&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data work.hotel;
Length Hotel_Name $9 Class $1 ;
INPUT Hotel_Name $ Class $ Country $ PRICE ;
CARDS ;
Appolpon A Greece 390
Caravel B Greece 468
Christina A Greece 427
Economy B Greece 369
EdenBeach A Greece 499
HanikianBeach C Greece 526
MarinaBeach C Greece 587
Xenia C Greece 534
Agdal B Maroc 447
Almohades B Maroc 482
Atlas A Maroc 511
AtlasArnadi C Maroc 532
Chems C Maroc 450
Dunes A Maroc 569
AlfaMa B Portu 646
AppDo B Portu 652
DELagos C Portu 802
Madeira A Portu 761
Reid's A Portu 1101
AbouSofiane A Tunis 434
Asdrubal A Tunis 489
Colombes B Tunis 436
Darnaour B Tunis 399
Djerba C Tunis 477
Mimosa C Tunis 375
Omarit B Tunis 486
;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'm trying to create a table with the countries as rows, the class as column and the name of the hotel with the minimum price for each pair.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Something like this :&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;        A           B           C
Greece  Appolpon    Caravel     Marinabeach
Portu   Madeira     Appdo       Delagos
Maroc   Atlas       Agdal       Chems&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I tried with proc tabulate and proc transpose but couldn't get exactly the result i'm looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Apr 2021 02:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738073#M230167</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-04-30T02:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot-table with minimum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738573#M230414</link>
      <description>Thank you, with your advices it finally worked.</description>
      <pubDate>Mon, 03 May 2021 12:55:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738573#M230414</guid>
      <dc:creator>jo_pariseau</dc:creator>
      <dc:date>2021-05-03T12:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot-table with minimum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738577#M230417</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/363334"&gt;@jo_pariseau&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Could you mind posting the code that worked?&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 13:07:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738577#M230417</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-05-03T13:07:36Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot-table with minimum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738583#M230419</link>
      <description>proc sort data=lib.hotels2 out=lib.hotels3;&lt;BR /&gt;by coutry class price;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sort data=lib.hotels3 out=lib.hotels4 NODUPKEY;&lt;BR /&gt;by coutry class;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc transpose data=devoir.hotels3 out=devoir.hotels4;&lt;BR /&gt;by country ;&lt;BR /&gt;id class;&lt;BR /&gt;run;</description>
      <pubDate>Mon, 03 May 2021 13:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738583#M230419</guid>
      <dc:creator>jo_pariseau</dc:creator>
      <dc:date>2021-05-03T13:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot-table with minimum</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738595#M230422</link>
      <description>&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 13:59:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Pivot-table-with-minimum/m-p/738595#M230422</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-05-03T13:59:51Z</dc:date>
    </item>
  </channel>
</rss>

