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

Announcements
See why IDC MarketScape names Qlik a 2025 Leader! Read more
cancel
Showing results for 
Search instead for 
Did you mean: 
josephinetedesc
Creator III
Creator III

Time dimension in a chart - how to make this dimensions respond to variables

Hi all

I have a chart and the x axis is: WeekStart(DateFull)

DateFull is able to be selected as Year, Month, week, day

I want to automate a bookmark or create a button???

Presently the user can select the week and the chart responds appropriately.

However in order to automate I want the chart to show the x axis from:

WeekStart(today() to WeekStart(Today() + 56)  ie a total of 8 weeks

The idea is to eventually email this weekly!

Thank you

Jo

1 Solution

Accepted Solutions
settu_periasamy
Master III
Master III

Hi,

If you have the WeekNum as Number (like 1,2,3,4..) , you can try the below expression

=sum({<WeekNum={">=$(=Week(Today()))<$(=Week(Today()+56))"}>}DurMins)

or , if you want to use your Date Field, try like..

=sum({<DateFull={">=$(=Today())<$(=Date(Today()+56))"}>}DurMins)

View solution in original post

12 Replies
josephinetedesc
Creator III
Creator III
Author

I have 2 variables:

vDateToday = Today()

and

vDateNT = Today() + 56

I have a feeling the expression below does not give me >= vDateToday  AND <= vDateNT.

Am I correct?

sum({<WeekNum = {">=$(vDateToday) <= vDateNT"}>}DurMins)

thanks Jo

tamilarasu
Champion
Champion

Hi Josephine,

Use Variable definitions like below.

     =Today((

     =Date(Today() + 56,'DD/MM/YYYY')

Capture.PNG

Expression as

sum({<WeekNum = {">=$(vDateToday)<=$(vDateNT)"}>}DurMins)

Capture.PNG

jagan
Partner - Champion III
Partner - Champion III

Hi,

What values are present in the WeekNum  field?  1,2,3,...etc.  In that case your expression won't work you have use date field like below if you have.


sum({<WeekNum =, DateFull= {">=$(vDateToday) <= vDateNT"}>}DurMins)



The other way is change the variables like below


vDateToday = Week(Today())

and

vDateNT = Week(Today() + 56)

sum({<WeekNum = {">=$(vDateToday) <= vDateNT"}>}DurMins)


Hope this helps you.


Regards,

jagan.




settu_periasamy
Master III
Master III

Hi,

If you have the WeekNum as Number (like 1,2,3,4..) , you can try the below expression

=sum({<WeekNum={">=$(=Week(Today()))<$(=Week(Today()+56))"}>}DurMins)

or , if you want to use your Date Field, try like..

=sum({<DateFull={">=$(=Today())<$(=Date(Today()+56))"}>}DurMins)

josephinetedesc
Creator III
Creator III
Author

odd - did not change the variable - but now it works ...

sum({<WeekNum = {">=$(vDateToday) <= vDateNT"}>}DurMins)

sum({<WeekNum = {">=$(vDateToday)<=$(vDateNT)"}>}DurMins)

josephinetedesc
Creator III
Creator III
Author

What I really want is WeekStart(DateFull)      Weeknum was a compromise.

but I suppose I cannot have everything???

Jo

settu_periasamy
Master III
Master III

I didn't get. Did you try the Second expression ?

=sum({<DateFull={">=$(=Today())<$(=Date(Today()+56))"}>}DurMins)


Can you provide the sample?

josephinetedesc
Creator III
Creator III
Author

The actual dimension is Weekstart(DateFull) as shown below

using WeekNum I get

does that make sense?  It is the format of weekstart as 29/02/2016 versus  2016/09.  I

Jo

tamilarasu
Champion
Champion

Could you attach your file.!! It would be easy for us to give a solution.