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

SQL Query with Qlikview

HI,

I have sql query which i have to implement in Qlikview.

Query

(SELECT MIN(date) 
FROM xyz A1
WHERE A1.dff=A.nid
P_code IN (58,656,46,49,10) ),'DD-MON-YYYY') NDate

How to write same SQL query in qlikview?

Labels (4)
3 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

The reference to table A comes from elsewhere in the script from which you cut this snippet. There is no way to implement that without some idea of what A is. In general, you could use this approach

LOAD Date(NDate, 'DD-MMM-YYYY') as NDate;
SQL SELECT MIN(date) as NDate, ...

But make sure that whatever you include in the SQL statement is a valid SQL expression in your DBMS.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jonathandienst
Partner - Champion III
Partner - Champion III

If A is a table, then you could use

LOAD Date(NDate, 'DD-MMM-YYYY') as NDate;
SQL SELECT MIN(date) as NDate
FROM xyz A1 
	left join <name of table A> A
WHERE A1.dff=A.nid
P_code IN (58,656,46,49,10)

or

LOAD Date(NDate, 'DD-MMM-YYYY') as NDate;
SQL SELECT MIN(date) as NDate
FROM xyz A1, <name of table A> A
WHERE A1.dff=A.nid
P_code IN (58,656,46,49,10)
Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Jacob
Contributor III
Contributor III
Author

actually i want to implement in expression can u plz help me with that.