Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
sujit_nath
Creator III
Creator III

SQL Scenario on historical data

SQL : I have 2 tables, one with current year data and othe with previous year data. Suppose current table is of 2018 and previous table is of 2017.

Fields are: Student Id, Name, Class, exam Type, subject, marks
I want to show the details of each student who got average marks less than 40 in previous year. What will be the query.

Labels (3)
3 Replies
Arthur_Fong
Partner - Specialist III
Partner - Specialist III

Is this the expected result?

clipboard_image_0.png

For current year:

avg({<Year={'$(=max(Year))'}>}marks)

 

Last year with marks below 40:

avg({<Year={"$(=max(Year)-1)"},marks={"<40"}>}marks)

 

Thanks and regards,

Arthur Fong

sujit_nath
Creator III
Creator III
Author

Hi Buddy,

Thanks for your response and effort, however, I was looking for a SQL query to achieve this. I know this community is specific to Qlik, but would be helpful if you can help with the query.

Brett_Bleess
Former Employee
Former Employee

Sujit, as you referenced in your reply, our forums are for Qlik products, in particular QlikView in this forum, you would be best off going to the Microsoft Communities in your case, or perhaps Stack Overflow or some other programming site, as I am doubtful you are going to get someone to write your SQL query for you here.  

I did a quick Google search on SQL Query help and got quite a few hits, was not sure which one(s) may be of help, so going to let you run that yourself to see if you can find what you need, but I saw CodeAcademy as well as W3Schools hits showing up as well as quite a few others, so I believe you should be able to find what you need.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.