Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am encountering an problem with the scatter plot where the data is not being colored as anticipated. I am confident that the issue does not lie with the chart itself but rather with the data. However, I am uncertain about the steps I should take to debug this issue.
Below is the data when I plot it in a table
Here crowd category calculated master dimension. When I convert the aforementioned data to a scatter plot and designate the color based on the dimension (crowd category), I am unable to visualize the "crowded" category as expected.
Qlik sense Version : November 2022
14.97.3
Crowd Category is defined as below
={<$(vLatest)>}if (
Aggr(Sum(queueLength),AREA_KEY,AreaName,AreaCapacity) > Aggr(Max(AreaCapacity),AREA_KEY,AreaName,AreaCapacity) ,'Crowded',
if (
Aggr(Sum(queueLength),AREA_KEY,AreaName,AreaCapacity) < Aggr(Sum(AreaNearCapacity),AREA_KEY,AreaName,AreaCapacity) ,'NotCrowded',
'NearCapacity'))
You aggregate within the if. To create a dimension from it, you should have it the other way around.
Here are my results, the data used and the code for the master dimension.
Data:
NoConcatenate Load RowNo() as AREA_KEY, * Inline [
AreaName,Area Capacity,AreaNearCapacity,Queue Length
Departure Security,90,60,40
Departure Emigration,80,50,112
Check in zones,50,35,95
Transfer Security,50,35,64
Self Service Bag Drop,30,20,22
];
=Aggr(
If(Sum([Queue Length]) <= Only([Area Capacity]),
If(Sum([Queue Length]) <= Only([AreaNearCapacity]),
'NotCrowded',
'NearCapacity'
),
'Crowded'
),
AREA_KEY
)
I only aggregate based on the AREA_KEY. I assumed the key is a unique identifier which makes the other fields redundant.