Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
devarasu07
Master II
Master II

Total Number of Week Count?


Hi All,


I'm trying to calculate how many weeks ago each article was lunched? it should be based on user selected Week and Year filter

I've used below formula,

=(Date(Max(TOTAL{<Article>}Date)) - Date(Min(TOTAL <Article> {<Article = {'*'}>}Date)))/7

Below is the excel formula which is giving correct output, i'want something similar in qlikview?

SUM((Current.Year - Article Launched Year)*53,(Current Week - Article Launched Week),1)+1

Untitled.jpg

Thanks,

Deva

1 Solution

Accepted Solutions
MK_QSL
MVP
MVP

RangeSum((Year(Date(Max(TOTAL{<Article>}Date))) - Year(Date(Min(TOTAL <Article> {<Article = {'*'}>}Date)))) * 53

,Week(Date(Max(TOTAL{<Article>}Date))) - Week(Date(Min(TOTAL <Article> {<Article = {'*'}>}Date))),1) + 1

View solution in original post

7 Replies
MK_QSL
MVP
MVP

Try this.

=(Date(Max(TOTAL{<Article>}Date)) - Date(Min(TOTAL <Article> {<Article = {'*'}>}Date)))/7

MK_QSL
MVP
MVP

You have Max Date 18/01/2017, then how come for C you have 2 weeks coming?

devarasu07
Master II
Master II
Author

Hi Manish,

Thanks, I've tried your expression and it's not matching with expected output and also if we select any year & week filter then the expression gives wrong result?  Total No.of Weeks difference based on user selected year and week from list box,


Please refer to the attached excel calculation and expected output.

You have Max Date 18/01/2017, then how come for C you have 2 weeks coming?

Yeah your right, it should fall on under week 3.


Thanks, Deva

MK_QSL
MVP
MVP

RangeSum((Year(Date(Max(TOTAL{<Article>}Date))) - Year(Date(Min(TOTAL <Article> {<Article = {'*'}>}Date)))) * 53

,Week(Date(Max(TOTAL{<Article>}Date))) - Week(Date(Min(TOTAL <Article> {<Article = {'*'}>}Date))),1) + 1

devarasu07
Master II
Master II
Author

Hi Manish,

How to exclude Week & year filter selection from your expression? No of Week launched should stick to user selected year and week filter.

RangeSum((Year(Date(Max(TOTAL{<Article>}Date))) - Year(Date(Min(TOTAL <Article> {<Article = {'*'},Week=,Year=>}Date)))) * 53

,Week(Date(Max(TOTAL{<Article>}Date))) - Week(Date(Min(TOTAL <Article> {<Article = {'*'},Week=,Year=>}Date))),1)

Regards, Deva

MK_QSL
MVP
MVP

Can you elaborate with an example please?

sunny_talwar

May be ignore them for Max also

RangeSum((Year(Date(Max(TOTAL{<Article, Week, Year>}Date))) - Year(Date(Min(TOTAL <Article> {<Article = {'*'},Week=,Year=>}Date)))) * 53

,Week(Date(Max(TOTAL{<Article, Week, Year>}Date))) - Week(Date(Min(TOTAL <Article> {<Article = {'*'},Week=,Year=>}Date))),1)