Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Save $600 on Qlik Connect registration! Sign up by Dec. 6 to get an extra $100 off with code CYBERSAVE: REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
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

1 Solution

Accepted Solutions
maxgro
MVP
MVP

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
Creator III
Creator III

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

jonathandienst
Partner - Champion III
Partner - Champion III

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
maxgro
MVP
MVP

you can use wildmatch to check your group

=

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

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

3))

Not applicable
Author

Wow cool thanks lots man it works