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: 
ravindraa
Creator
Creator

Cross table issue

Hi all,

  I have struck one place kindly give me suggestion on this.

I have data like this

Header 1Header 2Header 3Header 4Header 5Header 6Header 7
CountryIndicator19901991201320142015
Indiahelth1011121314

in this case i want to create one year field instead of individual years, for this i have created cross table every this is fine but instead of value year is showing under Value tab.

Please find the attached document ,

kindly give me suggestion on this.

thanks in advance..

1 Solution

Accepted Solutions
sunny_talwar

Try this:

Table:

CrossTable(Year, Value, 2)

LOAD [Country Name],

    [Indicator Name],

    [1960],

    [1961],

    [1962],

    [1963],

    [1964],

    [1965],

    [1966],

    [1967],

    [1968],

    [1969],

    [1970],

    [1971],

    [1972],

    [1973],

    [1974],

    [1975],

    [1976],

    [1977],

    [1978],

    [1979],

    [1980],

    [1981],

    [1982],

    [1983],

    [1984],

    [1985],

    [1986],

    [1987],

    [1988],

    [1989],

    [1990],

    [1991],

    [1992],

    [1993],

    [1994],

    [1995],

    [1996],

    [1997],

    [1998],

    [1999],

    [2000],

    [2001],

    [2002],

    [2003],

    [2004],

    [2005],

    [2006],

    [2007],

    [2008],

    [2009],

    [2010],

    [2011],

    [2012],

    [2013],

    [2014],

    [2015]

FROM

Crosstable2.xlsx

(ooxml, embedded labels, table is Sheet1);

FinalTable:

NoConcatenate

LOAD Year(Date#(Year, 'YYYY')) as Year,

  Value,

  [Country Name],

  [Indicator Name]

Resident Table

Where Len(Trim(Value)) > 0;

DROP Table Table;

View solution in original post

2 Replies
sunny_talwar

Try this:

Table:

CrossTable(Year, Value, 2)

LOAD [Country Name],

    [Indicator Name],

    [1960],

    [1961],

    [1962],

    [1963],

    [1964],

    [1965],

    [1966],

    [1967],

    [1968],

    [1969],

    [1970],

    [1971],

    [1972],

    [1973],

    [1974],

    [1975],

    [1976],

    [1977],

    [1978],

    [1979],

    [1980],

    [1981],

    [1982],

    [1983],

    [1984],

    [1985],

    [1986],

    [1987],

    [1988],

    [1989],

    [1990],

    [1991],

    [1992],

    [1993],

    [1994],

    [1995],

    [1996],

    [1997],

    [1998],

    [1999],

    [2000],

    [2001],

    [2002],

    [2003],

    [2004],

    [2005],

    [2006],

    [2007],

    [2008],

    [2009],

    [2010],

    [2011],

    [2012],

    [2013],

    [2014],

    [2015]

FROM

Crosstable2.xlsx

(ooxml, embedded labels, table is Sheet1);

FinalTable:

NoConcatenate

LOAD Year(Date#(Year, 'YYYY')) as Year,

  Value,

  [Country Name],

  [Indicator Name]

Resident Table

Where Len(Trim(Value)) > 0;

DROP Table Table;

ravindraa
Creator
Creator
Author

Thank you very much for reply Sunny..........

it is working for me...........................