Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

How Convert Record To Column and Calculate Difference

hello Dears

i have One Table Look Like

Table01.png

I would like to give the following

Table.png

1 Solution

Accepted Solutions

Re: How Convert Record To Column and Calculate Difference

This looks good (Just need a better sorting):

Capture.PNG

Script:

Table:

LOAD * Inline [

Year, Value

2005, 10

2006, 20

2007, 30

2008, 40

];

Concatenate (Table)

LOAD If(Previous(Year) > 0, Year & '-' & Previous(Year)) as Year,

  If(Previous(Value) > 0, Value - Previous(Value)) as Value

Resident Table;

6 Replies

Re: How Convert Record To Column

Check 'Horizontal' on the Presentation tab:

Capture.PNG

MVP
MVP

Re: How Convert Record To Column

Hi,
GENERIC LOAD is likely what you are looking for. See here for more info:

The Generic Load

How convert table from rows to columns

Miguel

Re: How Convert Record To Column

Just realized that you need to calculate delta also. It will be easy to add a value for change in the script. A script based solution works?

Not applicable

Re: How Convert Record To Column and Calculate Difference

Thanks How To Calculate Automatic Difference

2005-2006

2006-2007

2007-2008

...

Not applicable

Re: How Convert Record To Column and Calculate Difference

yes

but years is dynamic 2005,2006,2007,?

Re: How Convert Record To Column and Calculate Difference

This looks good (Just need a better sorting):

Capture.PNG

Script:

Table:

LOAD * Inline [

Year, Value

2005, 10

2006, 20

2007, 30

2008, 40

];

Concatenate (Table)

LOAD If(Previous(Year) > 0, Year & '-' & Previous(Year)) as Year,

  If(Previous(Value) > 0, Value - Previous(Value)) as Value

Resident Table;

Community Browser