Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Cyclic Group in Set Analysis for Selected Field

Hello!

I have the following Mekko Chart:

Untitled.png

With the Dimensions:

  • Zone (Values: Zone 1 / Zone 2 / Zone 3 / Zone 4)
  • Anomaly (Values: With Anomaly / No Anomaly)

And the Expression:

COUNT ({$<ID_TIME_DATE#={">=$(='$(vDateFrom)') =$(='$(vDateTo)')"}>} DISTINCT ACCOUNT_ID)

/

COUNT (TOTAL<ZONE> {$<ID_TIME_DATE#={">=$(='$(vDateFrom)') =$(='$(vDateTo)')"}>} DISTINCT ACCOUNT_ID)

Everything is great so far, but the thing is that now I want to add a cyclic group instead of having only the Zone Dimension, in order to have something like: Zone, Neighborhood, City, etcetera. The expression should be the same, except for the second part:


COUNT (TOTAL<ZONE> {$<ID_TIME_DATE#={">=$(='$(vDateFrom)') =$(='$(vDateTo)')"}>} DISTINCT ACCOUNT_ID)


Is there any way to calculate the TOTAL<ZONE> for every selected dimension from the cyclic group? (Replacing with TOTAL<ZONE> / TOTAL<NEIGHBORHOOD> / TOTAL<CITY> depending on the selection in the group).


I thought maybe using GETCURRENTFIELD (CyclicGroupName) which returns me the name of the field I'm using as a dimension.


But how could I use the function inside the total?


Or maybe creating a chart for every dimension and hide the others while showing one?


Or do you have any other idea of how to do that?


Thank you!!!

1 Solution

Accepted Solutions
tresesco
MVP
MVP

Try like:

Total <$(=GetCurrentField(GroupName))>

View solution in original post

3 Replies
Not applicable
Author

Hi,

Have no idea how to use GETCURRENTFIELD in Total, but you may use it in the expression.

if (GETCURRENTFIELD (CyclicGroupName)='ZONE' , COUNT (TOTAL<ZONE> {$<ID_TIME_DATE#={">=$(='$(vDateFrom)') =$(='$(vDateTo)')"}>} DISTINCT ACCOUNT_ID),

if (GETCURRENTFIELD (CyclicGroupName)='NEIGHBORHOOD' , COUNT (TOTAL<NEIGHBORHOOD> {$<ID_TIME_DATE#={">=$(='$(vDateFrom)') =$(='$(vDateTo)')"}>} DISTINCT ACCOUNT_ID),

if (GETCURRENTFIELD (CyclicGroupName)='CITY' , COUNT (TOTAL<CITY> {$<ID_TIME_DATE#={">=$(='$(vDateFrom)') =$(='$(vDateTo)')"}>} DISTINCT ACCOUNT_ID),

)

)

)

However, It's not that good solution.

tresesco
MVP
MVP

Try like:

Total <$(=GetCurrentField(GroupName))>

LynLuyt
Contributor
Contributor

Thanks - good suggestion and works well.