Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

QLIK SENSE: $(=GetCurrentField(Time))

At this time i am questioning that the GetCurrentField() function does work at all in SENSE. Does anyone have a working example to share ?

Thanks!

All,

i have a straight table in SENSE where i use a drill down dimension called "Time" as the only dimension.

My expression aggregates (amongst others) over the selected dimension.

In QlikView i would just do:

aggr [...]

,$(=GetCurrentField(Time))

[...]

I tried my expression in QlikView and it does the job. It SENSE it does not work..

Any idea what i might be doing wrong ?

Thanks!

6 Replies
Michael_Tarallo
Employee
Employee

Hi Philipp - I attempted to research this for you and could not get it to work either. I will submit to support for you so we can get more information.

I do not believe this works, because it's function is to return the current active group, which in this case (as defined in the Drill Down Dimension) may not be reference-able yet by this function.

Mike

http://help.qlik.com/sense/en-US/online/#../Subsystems/WorkingWith/Content/ChartFunctions/FieldFunct...

Regards,
Mike Tarallo
Qlik
paolo_mapelli
Creator II
Creator II

Hi Michael,

any news about "GetCurrentField" usage in Sense ?

I'm stuck at same problem. In my case I'm using a pie chart, with a drill-down (let's say: A->B) dimension. If A gets down to just one possible value (due to other dimensions filtering), pie char automatically drills down to B but it seems there's no way to programmatically know that the currently showed dimension is B.

Thanks in advance.

JonnyPoole
Former Employee
Former Employee

Paulo ,  currently the getcurrentfield() isn't valid in Sense .

Would you be interested in a potential workaround ?

Its a little klugy instead of using getcurrentfield() i'm using a count(distinct total) to check how many field values are within my selection.

Say you have Country->City->Customer drill path and at the top level (when viewing countries) you want the pie to count the number of cities.  When a user drills on one country and narrows the selection to just one country to see the cities within that country, then they want the measure to count the customers in each city.

Here is a conditional expression (think of it as long form version of getcurrentfield() )  to figure out which level of the hierarchy you are in.

In this example, the lowest level (customer) also shows the number of customers which doesn't make much sense but ... its just a quick example, you could add a nested IF to count ( distinct total city) = 1 and then display sum(SAles) or another metric at the lowest level.

Would this work for you ?

if (count( distinct total Country) > 1, Count(distinct City) , if ( count( distinct Country)=1 , Count(distinct Customer)))

Here is a 3 step drill visual of this in action:

Capture.PNG

Capture2.PNG

Capture3.PNG

paolo_mapelli
Creator II
Creator II

Hi Jonathan,

interesting trick, I'll give it a try.

Thanks indeed.

Paolo.

Allardata
Creator
Creator

Any update on this matter? I could really use the currently applicable dimension within a drill-down for two different expressions. Both a custom calculated maximum range, and coloring based on an AGGR function.

Alvaro_Palacios
Support
Support

Hey Philipp,

I had the same problem... GetCurrentField not supported in Qlik Sense. So I found the following workaround:

GetCurrentField() in Qlik sense ?

So I would just use the variable you create within you aggr expression:

aggr [...]

,$(vGetCurrentTimeFields)

[...]

Hope it helps,

Alvaro P.