Discussion Board for collaboration on QlikView Scripting.
I need the help of somebody for making a script.
I have two tables:
I would like to insert the previous two reels consumed to each product in the script.
In other words:
How can I do?
I am trying with ApplyMap but without succesfull.
Thanks in advance
You can use the FirstSortedValue in your script like this:
LOAD Product, Production, num(Production) as ProductionNumFROM ProdCons.xlsx(ooxml, embedded labels, table is Production);JoinLOAD Reel, Consumption, num(Consumption) as ConsumptionNumFROMProdCons.xlsx(ooxml, embedded labels, table is Consumption);Final:LOAD Product, Production, FirstSortedValue(Reel, -ConsumptionNum, 2) as Reel1, FirstSortedValue(Reel, -ConsumptionNum) as Reel2Resident ProductionWhere ConsumptionNum <= ProductionNumGroup By Product, Production;DROP Table Production; I've also attached the excel data for reference.
Hope this helps
Have a look at this blog by Steve Dark.
It gives you a idea of how to use ApplyMap.