Qlik Community

Qlik Sense Advanced Authoring

Discussion board where members can learn more about Qlik Sense Advanced Authoring.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Partner
Partner

Calculating % change from baseline in line chart

StudentProgram DayWeight
Bob A1205
Bob A10200
Bob A15198
John A1225
John A20220

 

Given the above table, I want to generate a line chart that displays, for each Student by Program Day, the % change in the Student's weight from their first recorded Weight value; ie (current weight - first weight) / first weight.  Note that I say first Weight instead of weight on Day 1 because the first weight doesn't have to coincide with Day 1 but it will always be recorded on the lowest Program Day value for that student. 

How do I reference the first weight value in my % change expression? 

Thanks, Steve

1 Reply
MVP & Luminary
MVP & Luminary

Re: Calculating % change from baseline in line chart

Maybe you could use something like this:

num(firstsortedvalue(Weight, -[Program Day]) / firstsortedvalue(Weight, [Program Day]) - 1, '0.0%')
   or maybe
num(firstsortedvalue(Weight, -[Program Day]) / only(Weight) - 1, '0.0%')

- Marcus