Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

change table structure

Hi guys,

I have some excel files like this:

    

codejan - 2016 feb - 2016mar - 2016
xxxxvalue 1 ........
yyyyvalue 2........
zzzzvalue 3........
kkkkvalue 4........

I would like to get this situation:

codemonthyearValue
xxxxjan2016value 1

yyyy

jan2016value 2
zzzzjan2016value 3
kkkkjan2016value 4

Or something where I can play with months and years.

Can I change the table structure with qlik script?

Thanks

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Like this?

Capture.PNG

Script:

Sample:

CrossTable(DateField, Values)

LOAD code,

    [jan - 2016],

    [feb - 2016],

    [mar - 2016]

FROM

[https://community.qlik.com/message/1277004]

(html, codepage is 1252, embedded labels, table is @1);

Inner Join

LOAD code, SubField(DateField,' ',1) as Month, SubField(DateField,' ',-1) as Year, Trim(Values) as Values Resident Sample Where SubField(DateField,' ',1) = 'jan';

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

3 Replies
micheledenardi
Specialist II
Specialist II

Use Crosstable function:

CrossTable(period,sales,1)

LOAD code,

     [jan 2016],

     [feb 2016],

     [mar 2016]

FROM

(ooxml, embedded labels, table is Foglio1);

2017-05-29 09_44_28-QlikView x64 Personal Edition - [C__Users_Michele.Denardi_Desktop_test.qvw_].png

Michele De Nardi
If a post helps to resolve your issue, please accept it as a Solution.
Anonymous
Not applicable
Author

Hi

Yes, you can change the table structure by using Cross table in Qlikview.

Hope it helps!!

Anil_Babu_Samineni

Like this?

Capture.PNG

Script:

Sample:

CrossTable(DateField, Values)

LOAD code,

    [jan - 2016],

    [feb - 2016],

    [mar - 2016]

FROM

[https://community.qlik.com/message/1277004]

(html, codepage is 1252, embedded labels, table is @1);

Inner Join

LOAD code, SubField(DateField,' ',1) as Month, SubField(DateField,' ',-1) as Year, Trim(Values) as Values Resident Sample Where SubField(DateField,' ',1) = 'jan';

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful