Discussion Board for collaboration on QlikView Scripting.
I do have a tabel containing all invoice prices for articles;
I would like to combine this 'latest/current price' in my main tabel containing all articles. This in the script, not in my presentation layer.
I use a 'mapping load' where I an searching on article number and returning the price. However this would return the first available record for this article.
How could I use a mapping where a 'date' parameter should also be applied : search on 'latest'
ApplyMap ('mapLatestPrice',Article,'0') AS Articel.LatestPrice,
ApplyMap ('mapLatestDate',Article,'') AS Articel.LatestDate,
the invoices table:
the second record should obvious be the result and not the first record.
Go to Solution.
The above script will give you a null value if there are more records of article with same date.
If possible order your Invoice table in the way with the date and article id.
Resident Invoices Order by Article_ID asc,Date desc;
Then you can write Script as
FirstValue(Price) as Price
Resident Invoices Group By Article_ID;
Hope it helps
Is your problem is to get the latest price of the article?
Is it in some way possible to add a search 'filter' to mapping load e.g.
resident Invoices where highest(date);
Check with this
FirstSortedValue(Price,-Num(Date)) as Price