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

Edit Script PIVOT Loaded Table

Hello,

I would like to transform a table that will be loaded in from SQL.  Is it possible to PIVOT this table in the 'Edit Script' statement, just like I would in SQL??

Thank You

3 Replies
Not applicable
Author

Hi,

Could you post a sample doc to get a clear idea??

We can pivot using cross tables/generic loads in edit script!!

Kiru

fkeuroglian
Partner - Master
Partner - Master

Please write and explain better your idea or what you want to do?

if will be easier to us to help you

thank you

Fernando

Not applicable
Author

So in this example it would be UNPIVOTing data.  Here tblRpt_US_CDFBP_SalesEffectiveness_MonthlyTrends has a column for M1, another columns for M2, and so on...and here i am JOINing on the 'Label' column in tblCfgDynamicLabels

SELECT  

various columns

  FROM

  ( SELECT * FROM tblRpt_US_CDFBP_SalesEffectiveness_MonthlyTrends WITH

  ) p

  UNPIVOT

  (y FOR numDay IN (M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12) )unpvt

  INNER JOIN

  --select * from

  tblCfgDynamicLabels lbl

  ON unpvt.numDay = lbl.Label

  ORDER BY  categoryorder DESC

I hope that this is helpful