Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
stephenedberkg
Creator III
Creator III

Previous week expression

My current week expression is

week(Date)  as week,

vWeek_1  = max(week)

vWeek_2  = max(week)-1

Sum({<weeks = {'$(vWeek_1  )'},Cal_Rep_FLAG ={1},>}Total_Call)

current week is working fine

my previous week is

Sum({<weeks = {'$(vWeek_2)'},Cal_Rep_FLAG ={1},week=>}Total_Call)


previous week is not working fine


if i click any week its working fine otherwise it show full values


help me  sunny


thanks in advance

6 Replies
YoussefBelloum
Champion
Champion

Hi,

maybe you have some spaces on your variables inside your Set analysis?

what is the difference between weeks and week fields ?

stephenedberkg
Creator III
Creator III
Author

sorry typing mistake that is week only

Sum({<week= {'$(vWeek_2)'},Cal_Rep_FLAG ={1},week=>}Total_Call)

YoussefBelloum
Champion
Champion

Using two time the field Week in set analysis like this, your expression will always take the Max(Week) regardless of the selected week

stephenedberkg
Creator III
Creator III
Author

give me the full expression plz

arulsettu
Master III
Master III

remove the week exclusion from set

Sum({<week = {'$(vWeek_2)'},Cal_Rep_FLAG ={1}>}Total_Call)

sunny_talwar

Try one of these

Sum({<weeks = {"$(=vWeek_2)"}, Cal_Rep_FLAG = {1}>} Total_Call)

or

Sum({<weeks = {"$(=$(vWeek_2))"}, Cal_Rep_FLAG = {1}>} Total_Call)