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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewaf
Creator
Creator

Selection change data..

Hi Guys,

as you can see below:

if i select just 2017 i got as budget 6640 which is correct,

if i select 2017 + AREA= Emea Distributor i got 6614 which is wrong

Anyone know why? i'm driving crazy...

find attached also the application

Selection.png

9 Replies
prieper
Master II
Master II

not all areas are mapped to region ...

qlikviewaf
Creator
Creator
Author

Everything is mapped, except "Corporate Adjustment" but it's ok

prieper
Master II
Master II

There is a calculation in it for calculating the budget. If you remove the

$(vWorkingDays)*$(vWorkingDaysSelected)

calculation seems to be fine.

Think that the error is within the logic of these variables, as values are calculated irrespectively your selections.

qlikviewaf
Creator
Creator
Author

I found that if i select Japan and Emea_Distributor i got the right amount, but honestly i don't get why i have to select both

prieper
Master II
Master II

Dear Antonio,

when you select EMEA_Distributor, the variable vWorkingDaysSelected changes from 260 to 259,

thus sum of Budget will be multiplied not with 260/260 but with 260/259.

qlikviewaf
Creator
Creator
Author

Good point, but why? i set the variable in order to not consider the AREA selection.

=Sum({<Area=,Region_Description=,Region=, Month=, Quarter=, Week=, Day=,Year=,Invoice_Date=,  Invoice_Date_Num={">=$(=Num(Min(Invoice_Date_Num)))<=$(=Max(Invoice_Date_Num))"}>} WorkingDay)

prieper
Master II
Master II

The variable is still calculated within the dataset, so for Spain the minumum data is 03/01, whilst for all others it it 02/01.

Am not that firm with SET and there might be other and better solutions, but suggest to create a variable

vYearSelected = GETFIELDSELECTIONS (Year)          // this way may work with multiple selections

and revise

vWorkingDaysSelected to

=SUM({1 <Year = {$(vYearSelected)}>} WorkingDay)

This variable would Sum all workingdays in the entires dataset, only considering the selection of the Year.

Peter

qlikviewaf
Creator
Creator
Author

ok Peter,

there's a way to generate missing value based on distinct on the sales table?
Thanks

prieper
Master II
Master II

don't get your point