Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
QlikWorld 2020: Join us May 11 - 14, 2020 in Phoenix, AZ. Register early and save $400. Learn More
Highlighted
Not applicable

getcurrentfield on group not working


Hi dears,

In a chart, I have a grouped dimension named Periodic with the 3 following groups on a date field:

1. =date(date#(Date,'DD/MM/YYYY'),'DD / MM')

2. =replace(Week, 'W', 'week ')

3. =date(date#(MonthName,'MMM YY'),'MM / YYYY')

When user selects the group =date(date#(Date,'DD/MM/YYYY'),'DD / MM')  on the chart i need to set a variable value vGroupPeriodic = 1

When user selects the group =replace(Week, 'W', 'week ') on the chart i need to set a variable value vGroupPeriodic = 2

When user selects the group =date(date#(MonthName,'MMM YY'),'MM / YYYY') on the chart i need to set a variable value vGroupPeriodic = 3

In a text box, I try the following if comparison but its not working:

=

if('['&GetCurrentField([Periodic])&']' = '[=date(date#(Date,'DD/MM/YYYY'),'DD / MM')]', 1, if('['&GetCurrentField([Periodic])&']' = '[=replace(Week, 'W', 'week ')]', 2, 3) )

Can you please help?

Thanks in advance

Tags (1)
1 Solution

Accepted Solutions
MVP
MVP

Re: getcurrentfield on group not working

you can use wildmatch to check your group

=

if(wildmatch(GetCurrentField(Periodic), '*date(date#(Date*'), 1,

if(wildmatch(GetCurrentField(Periodic), '*replace*'), 2,

3))

View solution in original post

4 Replies
muniyandi
Contributor III

Re: getcurrentfield on group not working

Hi Ashley,

you have to create Periodic  group field in data modeling level, then you will achieve the result.

Kindly refer my attachment file.

Thanks,

Muni

MVP
MVP

Re: getcurrentfield on group not working

Hi

I would put GetCurrentField([Periodic]) in a text box and confirm the results match your expression. In another text box, you could build the expression step by step.

However, it would be far simpler (and better performing) if you created these calculated dimensions as fields when you load the calendar.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
MVP
MVP

Re: getcurrentfield on group not working

you can use wildmatch to check your group

=

if(wildmatch(GetCurrentField(Periodic), '*date(date#(Date*'), 1,

if(wildmatch(GetCurrentField(Periodic), '*replace*'), 2,

3))

View solution in original post

Not applicable

Re: getcurrentfield on group not working

Wow cool thanks lots man it works