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

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
pgalvezt2021
Partner - Contributor III
Partner - Contributor III

API Structure Fields and Values Problem

Hello, 

I have been tried to order this wierd estructure Data Base, but I can't  reach out the output, I mean, Normal estructure with Columns and Rows. I have attached this Excel Test where the first sheet has a few registers of the base and the other sheet has the real output of what I want.

I hope you can help me with this,

 

Thanks !!!!!!! 

Labels (1)
2 Replies
pgalvezt2021
Partner - Contributor III
Partner - Contributor III
Author

Hello !!!!

Anybody can help me with this please,

Thanks !!!!!

Øystein_Kolsrud
Employee
Employee

Hi! That certainly is an odd one, but one thing you should look into is the "Generic Load" feature:

https://community.qlik.com/t5/Qlik-Design-Blog/The-Generic-Load/ba-p/1473470

Not knowing details of your data, it's hard to know what would be a safe way to do what you want, but here is at least an example that gets  you the desired output from that Excel file:

TaggedTable: LOAD
    Floor((RowNo()-1)/6) as T.Key,
	if(	Odd(__KEY_values)
      , Pick(Mod(RowNo()-1,6)+1, 'Unit', 'Description', 'SRV', 'Equip', 'Number', 'Date')
      , Pick(Mod(RowNo()-1,6)+1, 'Unit', 'Description', 'Equip', 'SRV', 'Number', 'Date')) as T.Type,
    [@Value_u0] as T.Value
FROM [lib://Excel/Data Test.xlsx]
(ooxml, embedded labels, table is [Data API Data BAse]);

GenericTable: Generic Load
	T.Key as Key,
    T.Type as Type,
    T.Value as Value
Resident TaggedTable;

Now one thing to note here is that the order of the columns differ from time to time (SRV and Equip) switches place. It coincides with the field __KEY_values which I used to select the column identifier order.

Hope that helps, and good luck!