Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Row values as fields (opposite of crosstable?)

Hey guys,

I'm doing a little more QV development these days (getting my feet wet with basic data modeling, etc.)

I have a table like this:

Field1AttributeValue
Axx1034
Ayy4076
Azz34
Bxx2345
Byy2435


where the attributes are actually field names...my desired table looks like this:

Field 1xxyyzz
A1034407634
B23452435--


If you could even provide the name of the script function required to pull this off, that would be a big help. Thanks!

17 Replies
Not applicable
Author

Generic Load is the correct answer.

Not applicable
Author

You could try something like the following:

TableA:

Load

     Field1,

     Attribute,

     Value1 & '_' & Value2 & '_' & Value3 as ConcatValues

From......;

let zFieldCount = FieldValueCount('Attribute');

for z = 1 to $(zFieldCount)
      let zFieldName = FieldValue('Attribute',$(z));   

      load
          Field1,
           subfield(ConcatValues,'_') as [$(zFieldName)]
      resident TableA
      where Attribute = '$(zFieldName)';

next z

marcelo_7
Creator
Creator

This is what I was looking for. Thanks!

ljackson
Creator
Creator

I agree with shumailh, I would use a pivot table and drag the values to the descired locations


hschultz
Partner - Creator
Partner - Creator

Great answer! Thank you for solving my problem

pandiarajan
Creator
Creator

Dear Alessandro,

Same Script i was use but table not found error comes

Not applicable
Author

exactly what I wanted !!

sebastian_fager
Contributor III
Contributor III

Hi,

This script works until the loop to join evertything togheter. It won't apply the left join, so i end up with a lot of tabells. What can i do?