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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
BI_Dev
Creator II
Creator II

Logic Help

I have data as below.

Date Parent Code Child Code Score
9/9/2022 A 1 5
9/9/2021   A 6
9/8/2022 B 2 10

 

Here I want to show score by date, but we also need to look at the ID's.

Parent Code A  should be adding score for Child Code 1 and A  score, so it will be 11 and we want to show the max date of Child Code.

Parent code B will show score 10 as there is just 1 record.

Output should be as below.

Date Parent Code Child Code Score
9/9/2022 A 1 11
9/8/2022 B 2 10
Labels (4)
1 Reply
ajaykakkar93
Specialist III
Specialist III

hi,
i hope it helps


data:
load
Date,
[Parent Code],
[Child Code],
Score;
load * Inline [
Date,Parent Code,Child Code,Score
9/9/2022,A,1,5
9/9/2021,A,,6
9/8/2022,B,2,10
];

 

finalData:
load [Parent Code],
sum(Score) as Score,
max(Date) as Date
Group by [Parent Code];
load
[Parent Code],
[Child Code],
Score,
Date,
12 as j
Resident data;


Drop Table data;

/*


output:
Date,Parent Code,Score
9/9/2022,A,11
9/8/2022,B,10


*/

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting