Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

Not applicable

Difference between getobjectfield and getcurrentfield functions

Hi folks,

Can any one let me know the difference between getobjectfield() and getcurrentfield() functions with examples.

Many Thanks!

Surendra

6 Replies
MVP & Luminary
MVP & Luminary

Re: Difference between getobjectfield and getcurrentfield functions

getobjectfield(0) returns the name of the first dimension of the chart the expression is used in. getobjectfield(1) returns the name of the second dimension, etc.

getcurrentfield returns the currently active field in a cyclic or drill down group. Since groups are independant of charts, the getcurrentfield function can also be used in expressions that are not used in a chart, but for example a text box.


talk is cheap, supply exceeds demand
Not applicable

Re: Difference between getobjectfield and getcurrentfield functions

Thanks Gysbert. I've understood the use of getcurrentfield function completely. I understood from you that getobjectfield is used in charts only. Can you give an example for expression that works with getobjectfield and also let me know the scenarios in which getobjectfield is used.

Not applicable

Re: Difference between getobjectfield and getcurrentfield functions

This functions does not seem exist/to work in Qlik Sense? GetObjectField does not work and GetCurrentField does not exist. 

I am trying to get the active field in a drill down dimension to calculate an average reference line using the AGGR by the active field in the drill down dimension.

shannonmarshall
New Contributor

Re: Difference between getobjectfield and getcurrentfield functions

Is there a way to use GetObjectCode as a ListBox to show just the columns in a particular chart?  What I am trying to do is give the user a vertical list of the columns used in a table so they can see it at a quick glance and not have to always scroll through the table.

karthiks_dwbi
Contributor III

Re: Difference between getobjectfield and getcurrentfield functions

trdandamudi
Honored Contributor

Re: Difference between getobjectfield and getcurrentfield functions

Here is an example regarding GetObjectField()  and hope this helps...

GetObjectField.jpg

Remember the index starts at 0 =GetObjectField(2,'CH02')

GetObjectField() will return the field name and not the contents. If you need the value in that particular column, Then use the below expression :

=concat(Distinct $(=GetObjectField(2,'CH02')),',')

Community Browser