Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
zfatima91
Contributor
Contributor

Change line style (e.g. from constant to dotted) using cyclic group

I would like to turn the line on my line chart into a dotted line from a constant one just for the most recent period. Right now my dimension is a cyclic group called MonthWeekDay which includes fields for Month, Week ending and Dates.  

So far I have added expressions into text objects to break a part my expression but I am having a hard time pulling it all together when creating the expression under 'Line Style.'

This is what I have broken it down to so far:

=if(max(Month), '<S3>' , '<S1>') 

=GetCurrentField(MonthWeekDay)

1 Solution

Accepted Solutions
zfatima91
Contributor
Contributor
Author

Hi Reuben,

Thank you for your help and sorry for the delay as I was on holiday! 

Your suggestion did work for the month dimension with GertCurrentField, however, for the weekend dimension I decided to use ReloadTime as that seemed like an easier option. I then used that for month as well. This is what I ended up with that worked: 

if(
(GetCurrentField(MonthWeekDay)= 'Week ending' and [Week ending] >= weekend(ReloadTime())-7)
OR
(GetCurrentField(MonthWeekDay)= 'Month' and monthstart(Month) = addmonths(monthstart(ReloadTime()),-1))
,'<S3>'
,'<S1>'
)

 

View solution in original post

3 Replies
rubenmarin

Hi, can you try with?:

=if(max(Month)=max(TOTAL Month)-1, '<S3>' , '<S1>') 

If there are different years in your chart maybe you need a period field that identifies both (year and month), to get only the last one.

Brett_Bleess
Former Employee
Former Employee

Zoha, did Ruben's suggestion work for you?  If so, do not forget to return to the thread and use the Accept as Solution button on his post to give him credit for the help and let others know it worked.  If you are still working on things, please leave an update.

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
zfatima91
Contributor
Contributor
Author

Hi Reuben,

Thank you for your help and sorry for the delay as I was on holiday! 

Your suggestion did work for the month dimension with GertCurrentField, however, for the weekend dimension I decided to use ReloadTime as that seemed like an easier option. I then used that for month as well. This is what I ended up with that worked: 

if(
(GetCurrentField(MonthWeekDay)= 'Week ending' and [Week ending] >= weekend(ReloadTime())-7)
OR
(GetCurrentField(MonthWeekDay)= 'Month' and monthstart(Month) = addmonths(monthstart(ReloadTime()),-1))
,'<S3>'
,'<S1>'
)