Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Michiel_QV_Fan
Specialist
Specialist

First numeric value in table

Hi, I need to find the first value in a table:

The table consists of these dimensions:

  • ProductID
  • reporting month
  • country

Fact:

  • Amount

And the values are a running sum where the first value is the start value.

I want to calculate the monthly difference which is easy but I do not get the starting value for each ProductID, reporting month etc. right. I keep on finding the first value of the total table or the last value of the previous product etc.

I tried previous functions, min(reporting month) in group by, peek etc but no luck so far.

1 Solution

Accepted Solutions
gardenierbi
Creator II
Creator II

Did you try with FIRSTSORTEDVALUE ?

View solution in original post

2 Replies
Anil_Babu_Samineni

Better to provide Sample data

Use something like below

=FirstSortedValue(Amount, -Aggr(Sum(Amount),ProductID))

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
gardenierbi
Creator II
Creator II

Did you try with FIRSTSORTEDVALUE ?