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: 
Atish
Contributor
Contributor

Scatterplot with no aggregation and with conditional expression

Hi Everyone,

I am trying to create a simple Scatter Plot without aggregation but with a condition.

My dataset is like this:

CD OFC_NO BKT VOL PCTG
XY 1 30 5 100
XY 2 30 15 100
XY 3 30 9 64.3
XY 3 100 5 35.7
AB 1 30 36 97.3
AB 2 100 1 2.7
AB 3 30 15 75
AB 3 45 1 5

The data is pre-aggregated.

I want to show a simple Scatter Plot (no aggregation) of OFC_NO as Dimension (so 1 bubble per OFC_NO), BKT as x-measure, PCTG as y-measure, VOL as size of bubble.

Following the examples given in Qlik community board, I see that I just have to give (BKT) instead of Sum(BKT) and (PCTG) instead of Sum(PCTG), and (VOL) instead of Sum(VOL).

However, an additional requirement is to restrict the chart to CD=="XY".

I can't do this using a filter panel/selection as I need to show the chart exactly for CD=="XY".

After looking up solved problems in the board, I see Qlik Sense lets me use a conditional expression like this but only if I do a Sum():

  Sum({<CD = {"FS"}>} BKT)

but this is not allowed:

  ({<CD = {"FS"}>} BKT)

Is there any way of doing this without aggregation?

Thanks,

Atish

Labels (1)
12 Replies
dplr-rn
Partner - Master III
Partner - Master III

ignoring the tool used to display
whats the PCTG value for OFB_NO = 3 you want to display?
Atish
Contributor
Contributor
Author

Hi Ranjith,

I would like the points to appear as in the graph I pasted (generated by pandas etc.).

So multiple values for same OFC_NO should be shown (it is guaranteed that CD + OFC_NO + BKT combination is unique).

In this case, OFC_NO = 3 would have two points, one for BKT=30 and one for BKT=100.

As in the graph I pasted, if multiple OFC_NOs have the same CD + BKT + PCTG combination, they would be shown as a single point to which they map.

This is for doing a quick trend analysis.

Thanks,

Atish

Atish
Contributor
Contributor
Author

One more thing for the Qlik Sense Creators to know and possibly include in a future QS version for better Scatterplots:
By adding a small jitter, scatterplots can show multiple overlapping points e.g. Seaborn's stripplot can do this.:
https://stackoverflow.com/questions/8671808/matplotlib-avoiding-overlapping-datapoints-in-a-scatter-...

Of course, a small random jitter can be added to the data prior to calling a simple scatterplot generator (also discussed in above article).