Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikView forum consolidation is complete. Labels are now required. LEARN ABOUT LABELS
cancel
Showing results for 
Search instead for 
Did you mean: 
vtatarnikov
Contributor III
Contributor III

Change results in a straight table with drilldown..please help

Hello.

I have the straight table:

1.png


After clicking on the "shop" (Наименование), "production cost" (Себ-ть) changes:

2.png

or

3.png

etc.

"Cost"(Себ-ть) =sum(Aggr(sum([Количество реализации])*FirstSortedValue([Цена закупки], -[Дата цены]), id_Товара))

                     (it is =sum(Aggr(sum([amount realization])*FirstSortedValue([purchase price], -[pricing date]), id_Goods)) )

Other numbers are considered to be from the "cost". Changing amount "store" one, but the total amount of all the shops remained unchanged 44 333 955. By goods production cost does not change with drilldown.

Schema:

4.png

One store (Магазин) may correspond to multiple warehouses (Склады). Sin on the keys (Key_Дата_Склад_Товар its Key_Date_Warehouse_Goods, and Key_Дата_Склад its Key_Date_Warehouse) and function "FirstSortedValue".

Sorry, for my english. Thanks in advance.

3 Replies
DavidFoster
Specialist
Specialist

Hi Vladislav

To help me understand... What are you using the 'FirstSortedValue' function for?

vtatarnikov
Contributor III
Contributor III

Hi David. One product, there are several wholesale prices, sorted by date. Multiplied by the number of realization the latest price:

exemple.png

DavidFoster
Specialist
Specialist

I suspect that is the problem then as you will be changing the range of prices available by making the selection. I would suggest having a proper association between the products and their prices. You can look at INTERVALMATCH as a way of joining tables based on a range. Alternatively do a LOOKUP function to more reliably find the price you are after.

Hope that helps