Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

datagrrl
Contributor III

Need to Subtract Measure for Current Time Period from Measure for Previous

I am not sure if this is a Set Analysis Question or not.

Basically I need to subtract the current time period measure from the measure for every time period across the dimension.

I do not have the "Variance from Current Quarter" in my dataset. I need to calculate that.

TimePeriodMeasurementMeasureVariance from Current Quarter
CurrentQuarterCoffee50
Q2-2014Coffee4-1
Q1-2014Coffee3-2
Q4-2013Coffee3-2
Q3-2013Coffee1-4
Q2-2013Coffee0-5
Q1-2013Coffee61
CurrentQuarterTea40
Q2-2014Tea117
Q1-2014Tea1-10
Q4-2013Tea9-2
Q3-2013Tea8-3
Q2-2013Tea2-9
Q1-2013Tea0-11
CurrentQuarterMilk1-10
Q2-2014Milk80
Q1-2014Milk6-2
Q4-2013Milk2-6
Q3-2013Milk91
Q2-2013Milk3-5
Q1-2013Milk1-7
CurrentQuarterSugar1-7
Q2-2014Sugar80
Q1-2014Sugar6-2
Q4-2013Sugar2-6
Q3-2013Sugar91
Q2-2013Sugar3-5
Q1-2013Sugar1-7

I took my crosstab table and made it longer by adding the Measurement Column, to take place of the data I recieved, which came to me like this:

TimePeriodCoffeeTeaMilkSugar
CurrentQuarter5411
Q2-201441188
Q1-20143166
Q4-20133922
Q3-20131899
Q2-20130233
Q1-20136011

If you can point me in the direction for the best way to do this, I would appreciate the help.

Thanks!

1 Solution

Accepted Solutions
datagrrl
Contributor III

Re: Need to Subtract Measure for Current Time Period from Measure for Previous

I did it through some scripting. I don't think it was the perfect answer, but it works.

View solution in original post

1 Reply
datagrrl
Contributor III

Re: Need to Subtract Measure for Current Time Period from Measure for Previous

I did it through some scripting. I don't think it was the perfect answer, but it works.

View solution in original post