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

Sum until weeknum

Hi all,

Im new to Qlik and trying to create a dashboard with the weekly sales for each Country. 

I've created a filter in which the weeknum can be selected. 

I want to create two tables, the fist one with the Weekly Sales from the selected week. This one succedes using this expression: Sum({$<PostYear={2019},[MIT JAV.Document Type]={0}>}[MIT JAV.Amount (LCY)])  Where the year is fixed at 2019, and document type has to be 0 (to leave out credits). 

The second table has to be the Total Sales of that year until the selected weeknum. I've tried alot of expressions now already, and none of them are working. Anyone has an idea to get this done?

I've added a Photo of how it should look in the end.

Kind regards

 

5 Replies
Uday_Pasupuleti
Partner - Creator III
Partner - Creator III

Try

Sum({$<PostYear={2019},[MIT JAV.Document Type]={0},weeknum={">=$(=min(weeknum))<=$(=max(weeknum))"}>}[MIT JAV.Amount (LCY)])

delfo
Contributor
Contributor
Author

This expression doesn't work: Sum({$<PostYear={2019},[MIT JAV.Document Type]={0},PostWeek={">=$(=min(PostWeek))<=$(=max(PostWeek))"}>}[MIT JAV.Amount (LCY)])

It gives me the same amount as for the selected week only. 

Sameer9585
Creator II
Creator II

Hey @delfo ,

-Try this may this works as per my understanding

Sum({<Date = {"$(='>=' & Date(WeekStart(Max(Date)), 'YourDateFieldFormatHere') & '<=' & Date(Max(Date), 'YourDateFieldFormatHere'))"}>} Sales)

delfo
Contributor
Contributor
Author

To bad, this one doen't work as well. 

 

 

Uday_Pasupuleti
Partner - Creator III
Partner - Creator III

Create a new field in the script
'WK'&week(DateField)&'-'&Year(DateField) as WeekYear

In the set analysis use
Sum({<Date ={">=$(=YearStart(Max(Date)))<=$(=max(Date))"}>}[MIT JAV.Amount (LCY)])

But make sure you use WeekYear field as a filter on the dashboard not just the Week field.