Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Qlik Analytics Tour 2020 Online. Begins August 10th. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
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!

 

4 Replies
Highlighted
MVP
MVP

Re: Please can someone help with a quick Set Analysis

What are you trying to achieve with the below condition

Week>=today()-365

?

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

Highlighted
Specialist
Specialist

Re: Please can someone help with a quick Set Analysis

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

 

Highlighted
Digital Support
Digital Support

Re: Please can someone help with a quick Set Analysis

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.
Highlighted
Digital Support
Digital Support

Re: Please can someone help with a quick Set Analysis

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.