You need to use CROSSTABLE here:
CROSSTABLE (3, CityName, CityValue) LOAD *
3 means the number of columns you want to keep as such (ID, Name, Address)
CityName is the name of the columns (New York, New Jersey, Main)
CityValues is Y/N or whatever the value is (x, null, etc)
Making a pivot table in the script is not possible. There is no such thing as a pivot table in your data model. All data will end up in "regular" tables.
The code examples they gave you are if you are trying to load data from a source file that is layout as a pivot table (aka cross table). To load those, use the example given.
After loading the data, the group column will be a dimension which you can than use in creating your pivot table in your front end.
Hope that clarifies it a bit.
If you use a pivot table and the expression below I believe you will get what you are looking for
=if(Count(ID) >= 1, 'X', ' ')
You will need to be on Qlik Sense 1.1 to use the pivot table.
Test.qvf 176.0 K