Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Weekstart in set analysis

Hi, QlikView

I have a dataset that looks like that

    

CompanyDateIncomeOther Income
Benz02.01.20172.078.0870
Benz03.01.20173.560.6145.000
Benz04.01.20173.703.2752.000
Benz05.01.20173.524.2761.000.000

I have one problem that I am trying to find solution. I have made a chart in the qlikview example.

That chart has two expressions sum (Income) and =sum({$<Date={'>=$(=WeekStart(Today(), 0))<=$(=Today())'}>}[Other Income])

I wanted to only get the other income for the current week.

My problem is that when I click on a date like 23.1.2017 my chart looks like below (chart 2). I know the set analysis for Other Income is the reason behind this. But can I use another set analysis that will show other income equals zero when I click on 23.1.2017 like chart 2.

Any ideas

  Chart 1

CompanyDateIncomeOther Income
Benz23.1.20172.325.13221.142
Benz24.1.2017032.563

  Chart 2

CompanyDateIncomeOther Income
Benz23.1.20172.325.13221.142

Regards Darri

1 Solution

Accepted Solutions
vinieme12
Champion III
Champion III

You can change the expression to below

=if(getselectedcount(Date)>0,sum([Other Income]),sum({$<Date={'>=$(=WeekStart(Today(), 0))<=$(=Today())'}>}[Other Income]))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.

View solution in original post

3 Replies
vinieme12
Champion III
Champion III

You can change the expression to below

=if(getselectedcount(Date)>0,sum([Other Income]),sum({$<Date={'>=$(=WeekStart(Today(), 0))<=$(=Today())'}>}[Other Income]))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.
suparnadas121
Contributor II
Contributor II

Please use (") instead of (') in the above expression: 

=if(getselectedcount(Date)>0,sum([Other Income]),sum({$<Date={">=$(=WeekStart(Today(), 0))<=$(=Today())"}>}[Other Income]))

 

markwood
Contributor II
Contributor II

You can try this expression to below

=if(getselectedcount(Date)>0,sum([Other Income]),sum({$<Date={'>=$(=WeekStart(Today(), 0))<=$(=Today())'}>}[Other Income])) Unlinked Apk