Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

ahidu1030
New Contributor II

last paid price among invoices suppliers locations materials

Hello Every one,

I have this table:

LocationSupplierMaterialInvoice DateInvoice VolumeInvoice Quantity

and one calculated key as %LocSuppMat with the combination of first 2 columns.

At the end I want to get a table with

location, supplier, material, Last paid Price.

I have tried the firstsoutedvalue function to calculate "Last Paid Price", but with no success.

=firstsortedvalue(distinct 100*("Invoice Volumn"/"Invoice Quantity"),-date#([INVL.Invoice date],'DD.MM.YYYY'),[%LocSuppMat])

But it shows me "-" in "Last Paid Price"

Anyone has an idea why?

1 Reply
felipedl
Valued Contributor III

Re: last paid price among invoices suppliers locations materials

Hi Xiaoyu,

From what I understood, I believe that you're using the Invoice Quantity as the column to get the Last Paid Price you want.

See if the attached QVW helps you, by only considering the last invoice date and summing the Invoice Quantity as shown below, by using set analysis with the [Flag to consider] field equal to 1.

Sample.png

Felipe.