Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Highlighted
pranaview
Contributor II

How to write different expression for two fields in a cyclic group

Hi Guys,

I have to write two separate expression for two fields in a cyclic group. So, for example, I have a cyclic group called GeoGroup which has two fields i.e, Region and Country. Now I have to use it in a bar chart but i want to make small change in my main expression based on the field the user selects in the chart. So, if the user selects Region, Exp_1 should be executed and if he/she selects Country field then the Exp_2 should get executed.

I tried implementing this using GetCurrentFields(GeoGroup) function but it doesn't work for some reason.

Any suggestion or a tip would be great as I need to get this done quickly.

Thanks,

Pranav

1 Reply
Partner
Partner

Re: How to write different expression for two fields in a cyclic group

Are you utsikt correct spelling for GetCurrentField(GeoGroup) ? It's not GetCurrentFields(GeoGroup) .

The pseudo expression below should work.

If(GetCurrentField(GeoGroup) = 'Country',
Sum(Countrymeasure1),
Sum(Othermeasure)
)
???
Celebrating my 300 accepted solution in the Qlik Community
???