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

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Need to calculate Overall based on Date

Hi,

I had a formula for Actuals- Forecast for each and every product based on some time restrictions from Date. When I select on Brand level, the overall value is not matching. But when i click on each and every product the value is correct.

For overall, the calculation should be based on date for every Product level.

Eg:

BrandProductDateActuals-JanActuals - FebActuals-MarchForecast-JanForecast- FebForecast-Mar

Formula(Actuals - Forecast)/sum(actuals)

B1P11/1/201625026028010015050260/2719 = 0.0956
B1P22/1/2016788789630250320411688/2585=0.2661
B1P33/1/2016266366260320230

180

the formula is calculated like if the Date of the product is Jan (Actuals and Forecast will be calculated for first two months). Eg. Jan and Feb is considered. Date of the product is Feb, Actuals and Forecast taken from Feb and March.

sum(actuals)= date of product is Jan then Jan and Feb whole actuals for all the products.


In my formula, I used the set Analysis for calculating the first two months based on the Date of Product and the Numerator is aggregated based on Primary key Brand_Product.


When I click on Product, I am able see the value correctly for each and every product. But when I click on Brand, overall should be 0.3617, but it was showing some different value.


I couldn't get how to calculate the numerator based on the Date so that while aggregating it should show the correct value for overall


1 Solution

Accepted Solutions
Not applicable
Author

The issue is resolved by creating flag in the datamodel for the restrictions of date. Then the overall calculation is achieved without any issue.

View solution in original post

3 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Please post a small qlikview document that demonstrates the problem


talk is cheap, supply exceeds demand
makrishnaraj
Contributor III
Contributor III

Hi,

the issue could be because of the total mode in the expression. try changing the total mode from default 'Expression Total' to Sum or average.

hope this will resolve your issue

Not applicable
Author

The issue is resolved by creating flag in the datamodel for the restrictions of date. Then the overall calculation is achieved without any issue.