Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I have a table as below:
Lender_offer_id | interactivity_data_type_id | description | subject_id | Value |
1 | 44 | Job situation | 3 | Uncertain |
1 | 45 | Debt | 3 | Light |
1 | 46 | Estimated living expenses per month | 3 | *** |
1 | 47 | Emeg-message | 3 | abc |
1 | 48 | Projected Emergency Fund | 3 | def |
1 | 49 | Do or Dont Exercise - # Incorrect | 3 | ghi |
1 | 50 | Do or Dont Exercise - Incorrect Answers | 3 | jkl |
2 | 44 | Job situation | 3 | Permanent |
2 | 45 | Debt | 3 | High |
2 | 46 | Estimated living expenses per month | 3 | *** |
2 | 47 | Emeg-message | 3 | 111 |
2 | 48 | Projected Emergency Fund | 3 | 222 |
2 | 49 | Do or Dont Exercise - # Incorrect | 3 | 333 |
2 | 50 | Do or Dont Exercise - Incorrect Answers | 3 | 444 |
However, I want to display the data as below. Kindly help in displaying the data.
Lender_offer_id | Job situation | Debt | Estimated living expenses per month | Emeg-message | Projected Emergency Fund | Do or Dont Exercise - # Incorrect | Do or Dont Exercise - Incorrect Answers |
1 | Uncertain | Light | *** | abc | def | ghi | jkl |
2 | Permanent | High | *** | 111 | 222 | 333 | 444 |
Create a pivot table object with Lender_offer_id as Row dimension, description as Column dimension and Only(Value) as measure.
may be this
NoConcatenate
ArrangeDataTmp:
LOAD * Inline
[Lender_offer_id, interactivity_data_type_id, description, subject_id, Value
1, 44, Job situation, 3, Uncertain
1, 45, Debt, 3, Light
1, 46, Estimated living expenses per month, 3, ***
1, 47, Emeg-message, 3, abc
1, 48, Projected Emergency Fund, 3, def
1, 49, Do or Dont Exercise - # Incorrect, 3, ghi
1, 50, Do or Dont Exercise - Incorrect Answers, 3, jkl
2, 44, Job situation, 3, Permanent
2, 45, Debt, 3, High
2, 46, Estimated living expenses per month, 3, ***
2, 47, Emeg-message, 3, 111
2, 48, Projected Emergency Fund, 3, 222
2, 49, Do or Dont Exercise - # Incorrect, 3, 333
2, 50, Do or Dont Exercise - Incorrect Answers, 3, 444];
NoConcatenate
ArrangeData:
LOAD
Lender_offer_id,
Value as [Job situation]
Resident ArrangeDataTmp
Where interactivity_data_type_id = '44';
Join
LOAD
Lender_offer_id,
Value as [Debt]
Resident ArrangeDataTmp
Where interactivity_data_type_id = '45';
Join
LOAD
Lender_offer_id,
Value as [Estimated living expenses per month]
Resident ArrangeDataTmp
Where interactivity_data_type_id = '46';
Join
LOAD
Lender_offer_id,
Value as [Emeg-message]
Resident ArrangeDataTmp
Where interactivity_data_type_id = '47';
Join
LOAD
Lender_offer_id,
Value as [Projected Emergency Fund]
Resident ArrangeDataTmp
Where interactivity_data_type_id = '48';
Join
LOAD
Lender_offer_id,
Value as [Do or Dont Exercise - # Incorrect]
Resident ArrangeDataTmp
Where interactivity_data_type_id = '49';
Join
LOAD
Lender_offer_id,
Value as [Do or Dont Exercise - Incorrect Answers]
Resident ArrangeDataTmp
Where interactivity_data_type_id = '50';
DROP Table ArrangeDataTmp;
EXIT SCRIPT;