Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have table below:
user_id | Subject_access_tracking_id | subject_id | Lender_offer_id |
2 | 27254 | 4 | 1154 |
2 | 158956 | 1 | 1154 |
2 | 158957 | 2 | 1154 |
2 | 158958 | 3 | 1154 |
7 | 7080 | 4 | 3 |
7 | 20026 | 1 | 3 |
12 | 149 | 4 | 4 |
12 | 158 | 1 | 4 |
12 | 166 | 2 | 4 |
12 | 167 | 3 | 4 |
13 | 40 | 1 | 5 |
13 | 41 | 2 | 5 |
13 | 42 | 3 | 5 |
13 | 44 | 4 | 5 |
However, I want to display like below:
user_id | Lender_offer_id | Selection_order |
2 | 1154 | 4,1,2,3 |
7 | 3 | 4,1 |
12 | 4 | 4,1,2,3 |
13 | 5 | 1,2,3,4 |
Kindly help me in displaying.
Try this :
myData: LOAD user_id, Subject_access_tracking_id, subject_id, Lender_offer_id FROM yourDbTable; residentData: Load *,RowNo() Resident myData; drop table myData;
Read about resident load - it plays imp role in Qlik data modelling.
Hi @Nikhil2725 ,
You can do this using resident load on original script,
load Concat(subject_id,',') as newSubID resident Data Group by user_id;
We have simpler way to do this,
Dimension : user_id
Exp1 : Lender_offer_id
Exp2 : =Concat( distinct subject_id,',',subject_id)
Hi,
If possible add RowNo() in your script along with other fields and use below exp , working for me :
=Concat(distinct subject_id,',', [RowNo()])
If you are loading this data from database then RowNo() will not work so use Resident load in that case to merge it with other fields.
I cannot share the app, just let me know you have DB script or loading data from excel?
As I am loading from EXCEL, it will be like below,
LOAD user_id, Subject_access_tracking_id, subject_id, Lender_offer_id, RowNo() FROM [C:\Users\KT3028\Desktop\test.xlsx] (ooxml, embedded labels, table is Sheet2);
But if your are loading data from DB, then it won't work. You need to use Resident load to make it done.
Regards