Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selecting only the last record from database

Hi,

Suppose I have the following :

ITEMNODATEQTY
00110/10/1110
00111/10/1120
00112/10/1130
00113/10/1140
00114/10/1150
00212/10/1110
00213/10/1120
00214/10/1130
00314/10/1130
00314/10/1150

How can I select only the last transactions for each ITEMNO? Below should be the selected rows.

00114/10/1150
00214/10/1130
00314/10/1150

Regards,

Marson

Labels (1)
1 Solution

Accepted Solutions
suniljain
Master
Master

Pls Check Following logic.

Load  

        ItemNo,

        Max(Date) as Date, 

        Sum(Qty) as Qty

from XYZ Group By ItemNo

View solution in original post

2 Replies
suniljain
Master
Master

Pls Check Following logic.

Load  

        ItemNo,

        Max(Date) as Date, 

        Sum(Qty) as Qty

from XYZ Group By ItemNo

Not applicable
Author

Hi,

I am also having a same kind of problem.

I have two tables One is having Month wise Net sales (LCY) and second table contains the month wise exchange rates. Now I want the third table contains the Net Sales figure / Month's exchange rate (say 10000 / 68.84027).

Upto this I don't have any problem, but when current month's excahnge rate is missing then I want my current month's Sales data should get treatment with the last month's exchange rate or last record of the exchange rate table.

[Net Sales]  / IF ([Year-Month] = '2012-01' , [Exchange Rate], if([Year-Month] = '2011-12', [Exchange Rate] ,0))

In my case IF condition which is in BOLD is not working.

Thanks in advance.