Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello!
I import data in te following form:
Apartment ID | AIR CONDITIONING | HEATING | BALCONY | PARKING |
255 | YES | NO | NO | NO |
301 | NO | YES | NO | YES |
075 | NO | NO | NO | NO |
111 | YES | YES | NO | NO |
023 | YES | YES | YES | YES |
I would like to create a chart/table as the following:
YES | NO | |
AIR CONDITIONING | =count({<AirCond={YES}>},AirCond)=3 | =count({<AirCond={NO}>},AirCond)=2 |
HEATING | =count({<Heating={YES}>},Heating)=3 | =count({<Heating={NO}>},Heating)=2 |
BALCONY | =count({<Balcony={YES}>},Balcony)=1 | =count({<Balcony={NO}>},Balcony)=4 |
PARKING | =count({<Parking={YES}>},Parking)=2 | =count({<Parking={NO}>},Parking)=3 |
Any idea of how I could do this?
Hello,
You can transpose the columns to rows by using a cross table .
TEST :
load * inline
[Apartment ID,AIR CONDITIONING,HEATING,BALCONY,PARKING
255,YES,NO,NO,NO
301,NO,YES,NO,YES
075,NO,NO,NO,NO
111,YES,YES,NO,NO
023,YES,YES,YES,YES];
Cross:
CrossTable([Facilities], [YESorNo?]) load [Apartment ID], [AIR CONDITIONING],[HEATING],[BALCONY],[PARKING] Resident TEST;
DROP TABLE TEST;
EXIT SCRIPT;
To create the table you want, you should use Facilities and YESorNO? as Dimensions then simply count the YESorNo? in the expressions section.