Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

stephenedberkg
Contributor II

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
Esteemed Contributor

Re: Previous week expression

Hi,

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

what is the difference between weeks and week fields ?

stephenedberkg
Contributor II

Re: Previous week expression

sorry typing mistake that is week only

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

YoussefBelloum
Esteemed Contributor

Re: Previous week expression

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
Contributor II

Re: Previous week expression

give me the full expression plz

arulsettu
Honored Contributor III

Re: Previous week expression

remove the week exclusion from set

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

MVP
MVP

Re: Previous week expression

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)