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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
jessica_webb
Creator III
Creator III

Reload data with renamed fields

I have a table as follows, created through many joins of different data sources:

IDSetTargetCurrentTypeValueExpected
68746A3275Target

32

65
68746A3275Current7565
2698A4534Target4512
2698A4534Current3412
968764B9814Target9832
968764B9814Current1432
21348C1288Target1278
21348C1288Current8878
9876B3535Target3561
9876B3535Current3561

What I would like now, is to keep the 'Expected' field, but reload it and add the data to the 'Type' and 'Value' fields

So for each ID and Set, I would have a third row with Type as 'Expected' and the corresponding value. Example:

IDSetTargetCurrentTypeValueExpected
68746A3275Target3265
68746A3275Current7565
68746A3275Expected6565

The 'Expected' column comes from a Left Join:

Left Join (TABLE)

IntervalMatch(Points, Set)

LOAD Lower_points,

  Expected,

  Set

Resident EXPECTED_TABLE;

So I tried adding:

Left Join (TABLE)

IntervalMatch(Points, Set)

LOAD Lower_points,

  Expected,

  Set,

  'Expected' as Type,

  Expected as Value

Resident EXPECTED_TABLE;

But that did nothing! I didn't get any errors, but also, my data didn't change!

20 Replies
jessica_webb
Creator III
Creator III
Author

Finally solved this with:

temp1:

CrossTable(Type, Value, 4)

LOAD

Data_point,

ID,

Set,

Subset,

Current,

Target

Expected

Resident TABLE;

LEFT JOIN (TABLE) LOAD *

Resident temp1;

Drop TABLE temp1;