Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Can someone help me convert this sql statement to qlikview script? I have these 2 records in qvd but not able to find the appropriate qlikview syntax to retrieve the record with smaller SQ#. Example below.
SELECT * FROM TableABC WHERE ClientID = 51710 AND SQ#=(select MIN(SQ#) from TableABC where ClientID=51710)
TableABC
ClientID SQ# TeamID Date
51710 2 4 20-JAN-11
51710 3 12 20-JAN-11
Hi Tommy,
you can do this with lookup( 😞
TableABC:
LOAD * INLINE [
ClientID,SQ#,TeamID,Date
51710,2,4,20-JAN-11
51710,3,12,20-JAN-11
];
LookupTable:
LOAD ClientID,
min(SQ#) as min_SQ#
Resident TableABC
Group By ClientID;
ResultTable:
NOCONCATENATE LOAD *
Resident TableABC
WHERE ClientID = 51710 AND SQ#=Lookup('min_SQ#', 'ClientID', ClientID, 'LookupTable');
Drop Table TableABC;
- Ralf
Hi Tommy,
you can do this with lookup( 😞
TableABC:
LOAD * INLINE [
ClientID,SQ#,TeamID,Date
51710,2,4,20-JAN-11
51710,3,12,20-JAN-11
];
LookupTable:
LOAD ClientID,
min(SQ#) as min_SQ#
Resident TableABC
Group By ClientID;
ResultTable:
NOCONCATENATE LOAD *
Resident TableABC
WHERE ClientID = 51710 AND SQ#=Lookup('min_SQ#', 'ClientID', ClientID, 'LookupTable');
Drop Table TableABC;
- Ralf
Hi guys,
Thanks so much! It worked perfectly.