Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
April 13–15 - Dare to Unleash a New Professional You at Qlik Connect 2026: Register Now!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Varince Calculation

Hi All,

I have to calculate variance as follows with eg data.

Date                             vlues

10-oct                            100 eg

18-oct                             190

25-oct                               500

28-oct                            300

5-sept                              900

10th-nov.                          300 

I took this date filed in Pivot table like this as a dimension and i have to add one field like varince and i took 1 in expression and i need script for calcaultion of varince between eg 5-sept and 10th nov

Date  10-oct      18-oct    25-oct    28-oct     5-sept    10th-nov.    varince

            100             190      500       300              900      300             -600(Expected value)

If your giving dynamic formula or static formula its help me.

Thanks,

Ravi Teja

1 Reply
wms_manis
Partner - Contributor III
Partner - Contributor III

I used the before function in the pivot table to calculate the variance. 

You can also use above it you pivot the table or use a straight table.  Search interchart functions to see how you can reference other values in a chart.

Another way is to use previous() or peek() in the load statement ordering the data by date.

I attached an example for the first approach.

Wade