Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
lessassy
Creator
Creator

Use variable to display a changing target based on dimension

Hello everyone,

I have several bar charts which display some values (let's say sales) based on weeknumber (at the format YYYY-MM) for  and month (at the format monthname-YYYY)Cycle group target.PNG

I used a cycle group to display week value and month value.

But the issue is every year the target evolved.

And each year there is a month target and in some case a week target.

I don't know how to do: "Ok qlikview if we are in this year then the target for this month is"

I tried if(year="maxstring(Year)",Target())

And even if it worked it wouldn't work for the month. Because i'm using a master calendar

MasterCalendar: 

Load 

               TempDate as Created,

               Year(TempDate) As Year,

               week(TempDate) As Week,

               WeekYear(TempDate) & '-' & Num(Week(weekstart(TempDate)),'00') as WeekYear,

               Month(TempDate) As Month,               

               Day(TempDate) As Day, 

               YeartoDate(TempDate)*-1 as CurYTDFlag, 

               YeartoDate(TempDate,-1)*-1 as LastYTDFlag, 

               inyear(TempDate, Monthstart($(varMaxDate)),-1) as RC12, 

               date(monthstart(TempDate), 'MMM-YYYY') as MonthYear, 

               ApplyMap('QuartersMap', month(TempDate), Null()) as Quarter, 

               WeekDay(TempDate) as WeekDay 

Resident TempCalendar 

Order By TempDate ASC; 

Drop Table TempCalendar; 

And i want to say to qlik view if the weeks or month belongs to a specifi year then apply the target to this specific month or week.

Do you know what would be the exact sentence for the variable overview pleaseee !!

Thank you in advance

0 Replies