Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
lnn
Contributor
Contributor

Creating a Change Calculation based on SD's per month within a customised time frame.

I have a set of sales data that spans over a year. I want to be able to calculate the sum of change sales per month.

 

For example, say I selected a date range of 01 Feb 2023 - 30 Apr 2023 using my filter pane. 

Feb sales were: 21, mar was: 22 and Apr was: 25 then the total change would be 4.

i.e. 22-21 = 1 and 25 - 22 = 3, 3+1 = 4

How do I create a query like this?

Labels (3)
2 Replies
cristianj23a
Partner - Creator III
Partner - Creator III

hi, try this code in script.

SalesData:
LOAD * INLINE [
Date, Sales
2023-01-01, 20
2023-02-01, 21
2023-03-01, 22
2023-04-01, 25
2023-05-01, 30
2023-06-01, 35
2023-07-01, 28
2023-08-01, 32
2023-09-01, 34
2023-10-01, 36
2023-11-01, 40
2023-12-01, 38
];

ChangeData:
LOAD
Date(MonthStart(Date)) AS MonthYear,
Sales - Previous(Sales) AS SalesChange
Resident
SalesData
Order By
Date;

cristianj23a_0-1690947833849.png

 

Regarts.

 

 

 

https://www.linkedin.com/in/cristianjorge/
Do not forget to mark as "Accepted Solution" the comment that resolves the doubt.
serives4
Contributor II
Contributor II

Creating a change calculation based on standard deviations (SDs) per month within a customized time frame involves using statistical analysis to track the changes in a dataset over time. The goal is to determine how much the data deviates from the mean (average) and quantify these deviations using standard deviations. Here's a step-by-step guide to creating such a calculation:

Step 1: Data Collection: Gather the dataset that you want to analyze. This dataset should include data points collected at regular intervals (e.g., daily, weekly, or monthly) over your desired time frame.

https://community.qlik.com/t5/Reporting-Service/

https://ipayhourlycalculator.com/

Step 2: Calculate the Mean and Standard Deviation: Calculate the mean (average) and standard deviation of the dataset. The mean represents the central tendency of the data, while the standard deviation measures the variability or spread of the data points around the mean.