Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
haribabugv
Creator
Creator

Set analysis inside set analysis review formula

Hello Qlikusers,

Need your help to update this formula to have set analysis inside set analysis.

I need to calculate forecast accuracy for definite period using vStart and vEnd for each planner.

So that chart should have three lines  and we can compare forecast accuracy of planner A, Planner B and Overall.

With the below code, i can calculate forecast accuracy. I need to create similar expression for each planner (ie A and B) . So can anyone give me leads on how to include field 'Planner' in the below set analysis expression?

num(sum({<Date*={">$(vStart)<$(vEnd)"}>}Sales * if((1-(fabs(Sales-Forecast))/Sales)<0,0,(1-(fabs(Sales-Forecast))/Sales)))/sum({<Date*={">$(vStart)<$(vEnd)"}>} Sales),'##0%')

@sunny_talwar

Labels (3)
1 Solution

Accepted Solutions
agni_gold
Specialist III
Specialist III

Check attached one

View solution in original post

2 Replies
agni_gold
Specialist III
Specialist III

Check attached one

jonathandienst
Partner - Champion III
Partner - Champion III

Probably something like:

sum({<Date *= {">$(vStart)<$(vEnd)"}, Planner = {'Planner A'}>} Sales *
    If((1-(fabs(Sales-Forecast)) / Sales) < 0, 0,
    (1-(fabs(Sales-Forecast))/Sales))
)
/ sum({<Date *= {">$(vStart)<$(vEnd)"}, Planner = {'Planner A'}>} Sales)

Similarly for Planner B, C.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein