Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
how to find top first value in the column through scripting.
I have a sql query i need to implement this query through script in qlikview.
i had already loaded these fields from excel.
SELECT TOP 1 [new value] FROM status_history
WHERE [defect id] = new.[defect id].
If you have read from excel you must use Load instead of select (this one loads from database)
so use this expression:
First 1 LOAD * resident mytable;
Hi
Try like this
First 1 Load NewValue;
SELECT [new value] FROM status_history
WHERE [defect id] = 34;
or
You can use directly like this
SQL SELECT TOP 1 [new value] FROM status_history
WHERE [defect id] = new.[defect id];
but new.[defect id] is referring any other table???
You can directly use SQL query as
SQL SELECT TOP 1 [new value] FROM status_history
WHERE [defect id] = new.[defect id].
HI
Try some thing like this
SELECT TOP 1 * FROM status_history
WHERE [defect id] = new.[defect id].
you can replace 1 with any number
Hi Nishika,
Try this:
SELECT TOP 1 column_name FROM table_name
ORDER BY column_name ASC;
Thanks,
AS
The error is odbc connection failed .
I had already loaded the column from my excel sheet and i need to perform this sql query in qlikview by implementing it through script I don't want to connect it with database from where i fetched the sql query.
If u want to fetch Top N values
1) Irrespective of order,
SELECT TOP N Column_Name FROM status_history
WHERE [defect id] = new.[defect id]
2) In Order, i.e Max N or Min N records,
SELECT TOP N Column_Name FROM status_history
WHERE [defect id] = new.[defect id]
Order by Column_Name ASC/DESC