Skip to main content
Announcements
Global Transformation Awards! Applications are now open. Submit Entry
cancel
Showing results for 
Search instead for 
Did you mean: 
DSTaylor
Contributor II
Contributor II

Please can someone help with a quick Set Analysis

Hi,

I'm relatively new to Qlik and heard about Set Analysis. 

It sounds like what I need as I have 2 parts to a calculation. The first part I do want to change with selections, the second part I don't. I believe it is in this second part where Set Analysis can come into play.

 

Here is my IF( statement for the 2nd part.

=sum(
if(Week>=today()-365,
if(Hrs>0,
ContractedHrs)))

 

Could someone please change this into a Set Analysis for me?

 

Thanks!

 

Labels (2)
4 Replies
tresesco
MVP
MVP

What are you trying to achieve with the below condition

Week>=today()-365

?

What is the definition (in script) of your field Week? 

jduenyas
Specialist
Specialist

Assuming you are counting Week number when you load data such as Week = 1,2,3....

Try

Week>=Week(today()-365)

The term Today()-365 results in a numerical value of date.

For today (2/6/2020) the term Today()-365 is 43502

 

Brett_Bleess
Former Employee
Former Employee

If either of the prior posts helped, please do not forget to return to that post and use the Accept as Solution button to mark it as the solution.  This gives the poster credit and lets other Members know what worked.  

Here is a Design Blog post on Set Analysis that should prove helpful, and there are further related links at the bottom of the post to other related posts, and I am putting the base URL to the Design blog after that for future reference, so you can search that area yourself for how-to items as there are over 700 posts in this area.

https://community.qlik.com/t5/Qlik-Design-Blog/A-Primer-on-Set-Analysis/ba-p/1468344

https://community.qlik.com/t5/Qlik-Design-Blog/bg-p/qlik-design-blog

Here is the Help link too, just in case:

https://help.qlik.com/en-US/qlikview/April2019/Subsystems/Client/Content/QV_QlikView/ChartFunctions/...

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Brett_Bleess
Former Employee
Former Employee

See duplicate posts: https://community.qlik.com/t5/forums/replypage/board-id/new-to-qlikview/message-id/385868

https://community.qlik.com/t5/QlikView-Scripting/Help-with-simple-Set-Analysis/m-p/1673037#M98209

Regards,
Brett

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.