Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi guys,
I have some excel files like this:
| code | jan - 2016 | feb - 2016 | mar - 2016 |
|---|---|---|---|
| xxxx | value 1 | .... | .... |
| yyyy | value 2 | .... | .... |
| zzzz | value 3 | .... | .... |
| kkkk | value 4 | .... | .... |
I would like to get this situation:
| code | month | year | Value |
|---|---|---|---|
| xxxx | jan | 2016 | value 1 |
yyyy | jan | 2016 | value 2 |
| zzzz | jan | 2016 | value 3 |
| kkkk | jan | 2016 | value 4 |
Or something where I can play with months and years.
Can I change the table structure with qlik script?
Thanks
Like this?
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';
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](/legacyfs/online/165051_2017-05-29 09_44_28-QlikView x64 Personal Edition - [C__Users_Michele.Denardi_Desktop_test.qvw_].png)
Hi
Yes, you can change the table structure by using Cross table in Qlikview.
Hope it helps!!
Like this?
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';