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

Announcements
Learn how to migrate to Qlik Cloud Analytics™: On-Demand Briefing!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I know in which dimension I am in a cycle dimension ?

Hi,

I have 3 geographical levels : City --> Country --> Continent (--> World).

I have 3 graphs representing the weight of the sales, ie. the sales of a level compared to the upper level.

In the graph "City", I show the sum of sales in the city, the sum of sales in the corresponding country, and the ratio.
In the graph "Country", I show the sum of sales in the country, the sum of sales in the corresponding continent, and the ratio.
In the graph "Continent", I show the sum of sales in the continent, the sum of sales in the world, and the ratio.

error loading image

I would like to replace the 3 graphs by only 1 graph, with a cycle dimension.

The problem is that I don't know how to say in my expression "if I am in the dimension XXX then ...".

1 Solution

Accepted Solutions
Not applicable
Author

You're looking for the GetCurrentField() function. If you use:

=GetCurrentField(Geo)
it will return the name of the current dimension.

Then you would just use:

if(GetCurrentField(Geo) = 'Country', ..., if(GetCurrentField(Geo)='City',...))


EDIT: I attached a sample, but one of the charts is different. I put the selected Geo in the chart header too.

View solution in original post

3 Replies
Not applicable
Author

I have an alternate solution : create a new selector to choose which dimension have to be used.

I think it's not the best solution.

Not applicable
Author

You're looking for the GetCurrentField() function. If you use:

=GetCurrentField(Geo)
it will return the name of the current dimension.

Then you would just use:

if(GetCurrentField(Geo) = 'Country', ..., if(GetCurrentField(Geo)='City',...))


EDIT: I attached a sample, but one of the charts is different. I put the selected Geo in the chart header too.

Not applicable
Author

Exactly what I was looking for ! Yes

Thank you very much !