Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
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
sunny_talwar

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;

View solution in original post

6 Replies
sunny_talwar

Check 'Horizontal' on the Presentation tab:

Capture.PNG

Miguel_Angel_Baeyens

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

sunny_talwar

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
Author

Thanks How To Calculate Automatic Difference

2005-2006

2006-2007

2007-2008

...

Not applicable
Author

yes

but years is dynamic 2005,2006,2007,?

sunny_talwar

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;