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

Set Analysis Date Range

sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={">=$(=replace(Weekname(Today()-77), '/', '-'))"}

  >}

This works fine and gives me my result.

However, I want to do a a range of 77 days (11 weeks) and 35 days (5 weeks). The minute I put in the greater than symbol, I get 0

sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={">=$(=replace(Weekname(Today()-77), '/', '-')) <=$(=replace(Weekname(Today()-77), '/', '-'))"}

  >}

Any help appreciated

9 Replies
Clever_Anjos
Employee
Employee

Please try changing (adding/removing) spaces around <=

Meantime, please add this expression to a straight table expression with no header.

Mouse over the header and check how your expression is beeing evaluated

Anil_Babu_Samineni

This works fine and gives me my result.

However, I want to do a a range of 77 days (11 weeks) and 35 days (5 weeks). The minute I put in the greater than symbol, I get 0

sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={">=$(=replace(Weekname(Today()-77), '/', '-')) <=$(=replace(Weekname(Today()-77), '/', '-'))"}

  >}

Any help appreciated

Looks like, >= and <= are same conditions. Are you going to do this? >= 2017-30 and <= 2017-30 ??

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
bobbydave
Creator III
Creator III
Author

That is a typo

sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={">=$(=replace(Weekname(Today()-77), '/', '-')) <=$(=replace(Weekname(Today()-35), '/', '-'))"}

  >}

Still doesnt work

bobbydave
Creator III
Creator III
Author

I ended up creating a a number of set analysis for each week and got the result.

Set analysis for 77 days

set analysis for 70 days

.

.

.

set analysis for 35 days

and added these all together to get my result. Long winded but works

bobbydave
Creator III
Creator III
Author

>=2017-37<=2017-30

That was a typo in my original script

lorenzoconforti
Specialist II
Specialist II

Do you mind sharing your application? Maybe we can find a better way of achieving the expected result

There was another user having a similar issue a couple of days ago but I don't think it got resolved as the application couldn't be shared

bobbydave
Creator III
Creator III
Author

I was able to do it another way for individual weeks to get the desired result. I was trying to do it using a date range which i couldnt figure out. Here is how i got around it.

= (sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={"$(=replace(Weekname(Today()-77), '/', '-'))"}

  >}

[Weekly Record Count])

+

sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={"$(=replace(Weekname(Today()-70), '/', '-'))"}

  >}

[Weekly Record Count])

+

  sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={"$(=replace(Weekname(Today()-63), '/', '-'))"}

  >}

[Weekly Record Count])

+

  sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={"$(=replace(Weekname(Today()-56), '/', '-'))"}

  >}

[Weekly Record Count])

+

  sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={"$(=replace(Weekname(Today()-49), '/', '-'))"}

  >}

[Weekly Record Count])

+

  sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={"$(=replace(Weekname(Today()-42), '/', '-'))"}

  >}

[Weekly Record Count])

+

  sum(

  {<

  Country -= {'Korea', 'Latvia', 'Northern Ireland'},

[Weekly Control Description] -= {'Avaya'},

  Fiscal_Year_Week ={"$(=replace(Weekname(Today()-35), '/', '-'))"}

  >}

[Weekly Record Count]))

Clever_Anjos
Employee
Employee

Did you do this

"Meantime, please add this expression to a straight table expression with no header.

Mouse over the header and check how your expression is beeing evaluated"

Anil_Babu_Samineni

Please check validation in Text boxes ..

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful