6 Replies Latest reply: Dec 15, 2016 11:43 AM by Sunny Talwar RSS

    Sum between first date and max selection date

    Vegard Rafteseth

      Hi there.

       

      I'm quite new to Qlik, and I've tried to search for the answer, but with no success.

      I was hoping you could help me out on this scenario.

       

      I'm working on an app for inventory balances, which pretty much means I have to sum everything from first date to "max of selection date" if you know what I mean.

       

      I'm creating a line chart, but all that does at the moment is summing the transactions within the date selections I make. That's obvious and I get that. But how would I go about accumulating the values of the selections I make?

      The goal is a line chart showing the inventory balance by year, month and day (as a drilldown).

       

      I have a MasterCalendar, and I made a field min(Date) as FirstDate resident MasterCalendar.

      I was thinking the only way I'd be able to do this is through setting a daterange from FirstDate to.. max selected date, but I'm struggling.

       

      I've been trying various approaches, but could you please advise?

      This just sums the selection range.

      =sum({$ <Date={">=$(=FirstDate)<=$(max(Date))"}>}Amount)

       

      =sum({$ <Date={">=$(=FirstDate)<=$(=LastDate)"}>}Amount)

       

      =sum({$ <Date={">=1(=FirstDate)<=$(=LastDate)"}>}Amount)

       

       

      I'm new, please bear with me

       

      Kind regards,

      Vegard