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

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
NewbieToQV
Contributor II
Contributor II

Find difference between 2 values across a certain date range

Hi, I need help on the below.

I have grades of some students and need to know if they improved on the results based on the latest 2 tests. (i.e. I need the result tab in yellow). 

Screenshot 2024-01-18 193911.png

I am on QlikView and appreciate your assistance. Many thanks.

Labels (2)
3 Replies
rwunderlich
MVP
MVP

What does you data table look like when loaded into QV? Can you post a screenshot of the table model?

-Rob

Saravanan_Desingh
MVP
MVP

Try something like this,

tab1:
CrossTable(Month, Grade)
LOAD * INLINE [
    ID, 1/1/23, 2/1/23, 3/1/23, 4/1/23, 5/1/23, 6/1/23, 7/1/23, 8/1/23
    1000, , , A, B, Pass, , , 
    1001, , , , , , , D, 
    1002, , , , , , D, , A
    1003, A, B, B, , , , , 
];

Left Join(tab1)
LOAD ID, Concat(If(Not Len(Trim(Grade))=0,Grade&'@'),'',Date#(Month)) As C1
Resident tab1
Group By ID;

Left Join(tab1)
LOAD ID, SubField(C1,'@',-3) &'->'& SubField(C1,'@',-2) As Rationale,
	If(SubField(C1,'@',-2) > If(SubField(C1,'@',-3)='Pass','Z',SubField(C1,'@',-3)), 'Deteriorate',
		If(SubField(C1,'@',-2) < SubField(C1,'@',-3), 'Improve',
			'n/a')) As Result	
Resident tab1;

commqv006.png

NewbieToQV
Contributor II
Contributor II
Author

Thanks!

I don't have access to the script. Any solution to do at the chart/table properties?