Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am new to qlikview please help me to implement below script in qlikview.
SELECT t.P_id, t.C_id, t.C_date, t.C_score
FROM temp t
INNER JOIN (SELECT P_id, C_id, Max(C_date) AS mdate, C_score
FROM temp
WHERE C_date >= "2018-11-17" and C_date <= "2018-11-20"
GROUP BY P_id) AS a
ON a.P_id = t.P_id AND a.mdate = t.C_date
Assuming that the SQL query you listed works, use the following
Load
P_id,
C_id,
C_date,
C_score;
SQL SELECT t.P_id, t.C_id, t.C_date, t.C_score
FROM temp t
INNER JOIN (SELECT P_id, C_id, Max(C_date) AS mdate, C_score
FROM temp
WHERE C_date >= "2018-11-17" and C_date <= "2018-11-20"
GROUP BY P_id) AS a
ON a.P_id = t.P_id AND a.mdate = t.C_date ;
If you want to change any field names in your Qlik model then use "as" (I made up an example below).
Load
P_id as [Person ID],
... etc.
Don't forget the ";" after the load statement and the SQL statement, or you'll get an error. Note that your "Select" statement is now receded by the word "SQL".
Enjoy.