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

Measure for the week only

Hi - 

I have two fields I am focusing on - Date and Amount.

The Date 'data' has all of the autocalendar features.

How do I set it to where if a specific date range is selected, it can display the Amount ONLY for all of the dates in that week ?

Example - if one date is selected in that week, it shows a total of the Amount for the entire week and NOT just that date.

 

Thanks - Jerry

1 Solution

Accepted Solutions
Channa
Specialist III
Specialist III

week(date) it will bring week from select date

Sum({<Date=, Week={'$(=week(Date))'}>}Amount)

u can pass selected date into variable

 

vWeek=week(Date)

Sum({<Date=, Week={'$(vWeek)'}>}Amount)

Channa

View solution in original post

6 Replies
Vegar
MVP
MVP

Try something like this:
Sum({<Date, YearWeek={'$(=WeekName(max(Date)))'}
>}Amount)

 

Or maybe this:

Sum({<Date= {">=$(=weekstart(MIN(Date)))<=$(=weekend(MAX(Date)))"}
>}Amount)

bing_jville
Contributor III
Contributor III

How about change the date field used in the date filter to

Dual(date, YearWeek) 

Channa
Specialist III
Specialist III

week(date) it will bring week from select date

Sum({<Date=, Week={'$(=week(Date))'}>}Amount)

u can pass selected date into variable

 

vWeek=week(Date)

Sum({<Date=, Week={'$(vWeek)'}>}Amount)

Channa
Vegar
MVP
MVP

@Channa Week() will only gives you the week number, if your data runs over multiple years you will need to use a column using both weeknumber and year like weekname().

jonathandienst
Partner - Champion III
Partner - Champion III

And the variable vWeek will only work with a date selected. Use Vegar's suggestions above.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jerryr125
Creator III
Creator III
Author

Hi - this seemed to do the trick :

 

Sum({<Date=, Week={'$(=week(Date))'}>}Amount)

 

Thank you - Jerry