Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cross table manipulation

Hi

I want to manipulate the following table into a crosstable.

PRIMARY_TICKERSALES_BRAZILFY 2012SALES_BRAZILFY 2013SALES_BRAZILFY 2014
0486.HK65450
1010.SE401050

I was hoping to edit the titles so that I can pull back the extra granularity of the year. (without the "FY" even better!)

This is an example of how I was hoping to transform the data? Any ideas?

Thanks very much in advance

PRIMARY_TICKERRegionYearData
0486.HKSALES_BRAZILFY 201265
0486.HKSALES_BRAZILFY 201345
0486.HKSALES_BRAZILFY 20140
1010.SESALES_BRAZILFY 201240
1010.SESALES_BRAZILFY 201310
1010.SESALES_BRAZILFY 201450
11 Replies
MarcoWedel

or maybe better:

QlikCommunity_Thread_131168_Pic3.JPG.jpg

QlikCommunity_Thread_131168_Pic4.JPG.jpg

tabColName:

CrossTable (ColID, ColName)

LOAD RecNo() as RecNo, *

FROM [http://community.qlik.com/thread/131168] (html, codepage is 1252, no labels, table is @3)

Where RecNo()<3;

mapColName:

Mapping LOAD

  ColID,

  Concat(ColName, ':', RecNo) as ColName

Resident tabColName

Group By ColID;

DROP Table tabColName;

tabData:

CrossTable (Col, Value)

LOAD *

FROM [http://community.qlik.com/thread/131168] (html, codepage is 1252, no labels, table is @3)

Where RecNo()>3;

Left Join (tabData)

LOAD Col,

    SubField(Category, ':', 1) as Category,

    Dual(SubField(Category, ':', 2), Right(SubField(Category, ':', 2),2)) as FY;

LOAD Distinct

  Col,

  ApplyMap('mapColName', Col) as Category

Resident tabData;

RENAME Fields using mapColName;

DROP Field Col;

hope this helps

regards

Marco

Not applicable
Author

Thank you so much - that is exactly what I needed!

So to complicate things further the file actually has a few other columns (and the first row) that need to be purged.  I deleted them from the example for simplicity but when I try and replicate your code I am having issues!

Can you please help me adapt the code to purge the columns below and the first row?

(2nd-10th column "Company" name to  "TPP" need to be deleted

Thank you very much again for your help,

Tok

30313233343536373839404142434445
TickersCompany nameSedolSectorRatingListMarket cap (current)PriceTPUpsideTPPGS EPS YTD revisionsGS EPS 12m revisionsGS EPS 1w revisionsConsensus
  EPS YTD revisions
Consensus EPS 12m
  revisions
FY14FY15FY16FY17FY14FY15FY16FY17FY14FY15FY16FY17FY14FY15FY14FY15
MAERSKb.COA.P. Moeller-Maersk4253048TransNeutral                           
  42,382
14370.0014500.001%12 months 0.0%0.0%0.0%0.0%5.5%-3.8%14.1%2.7%
A2.MIA2a SPA5499131UtilitiesNeutral 2,596 0.830.9312%12 months11.5%8.1%4.7%-8.8%39.8%66.2% 0.0%0.0%0.0%0.0%0.0%1.7%0.0%1.7%
AALB.ASAalbertsB1W8P14SmallMidBuy                             
  2,298
21.0129.0038%6 months-12.6%-11.0%-13.3%-14.9% 0.0%0.0%0.0%0.0%-3.1%4.7%-1.9%1.7%
ABBN.VXABB Ltd7108899MachinerySell                           
  39,657
20.8520.50-2%12 months-10.2%-17.9%-20.5%-16.0%-13.1%-22.5% 0.0%0.0%0.0%0.0%-23.7%-17.4%-23.7%-17.4%