Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
HugoBoyle
Contributor II
Contributor II

Set Analysis not Working

Hi,

I have been struggling with a Set Analysis in Qliksense.

I have a table with Sales by Year/Week in YYYYWW format.

I have set up a couple of variables to calculate the Start week number and the End week number for the last 13 Weeks for the previous year (i.e. 202210 to 202223)

Start Week Variable (V13Weeks_PY):

=IF(NUM(Week(Weekstart(Today())-2)-13,'00') > NUM(Week(Weekstart(Today())-2),'00') or NUM(Week(Weekstart(Today())-2)-13,'00') <= 0,
YEAR(Today())-2,
YEAR(Today())-1 )
&
IF(NUM(Week(Weekstart(Today())-2)-13,'00') = 0, NUM('52','00'),
IF(NUM(Week(Weekstart(Today())-2)-13,'00') < 0 , 52 + NUM(Week(Weekstart(Today())-2)-13,'00') , NUM(Week(Weekstart(Today())-2)-13,'00') )
)

 

End Week Variable (V13WeeksEnd_PY):

=(YEAR(Today())-1&NUM(Week(Weekstart(Today())-2),'00'))

Set Analysis:

I have set up my Set Analysis as follows.

SUM(
{<
YearWeek ={">=$(V13Weeks_PY) <=$(V13WeeksEnd_PY)"}
>}
Sales)

The line at the Bottom of the screen shows me..

OK: SUM({<YearWeek ={">=202210 <=202223"}>}Sales)

This is not pulling out my sales for just these 13 weeks but seems to just give a the same total for each year/Week.

Labels (1)
1 Solution

Accepted Solutions
agigliotti
Partner - Champion
Partner - Champion

Hi @HugoBoyle ,

First make sure you don't have space in the values (">=202210 <=202223").

It should be ">=202210<=202223"

Best Regards

View solution in original post

5 Replies
agigliotti
Partner - Champion
Partner - Champion

Hi @HugoBoyle ,

First make sure you don't have space in the values (">=202210 <=202223").

It should be ">=202210<=202223"

Best Regards

HugoBoyle
Contributor II
Contributor II
Author

Thanks. It was that simple. I spent ages trawling through the different variations and could not get this to work.

 

jamesanderson934
Contributor
Contributor

  1. Check the Syntax: Review the syntax of your set analysis expression carefully. Ensure that you have used the correct set operators, such as '=' or '>', and that you have enclosed your set conditions within curly braces '{}' appropriately. Check for any missing or misplaced parentheses, commas, or quotation marks.

  2. Verify the Field Names: Double-check that the field names used in your set analysis expression match the actual field names in your data model. Case sensitivity matters, so make sure the field names are correctly capitalized to check the ausweis faken

muhammadrauf
Contributor II
Contributor II

The phrase "Set Analysis not working" is quite vague and could refer to a problem in various contexts, such as data analysis or software development. To provide a helpful response, I would need more specific information about the situation, such as the software or tool you are using, the error message or issue you're encountering, and any relevant details about your analysis or project. get more information click here

muhammadrauf
Contributor II
Contributor II

The statement "Set Analysis not functioning" lacks specificity and could pertain to issues in diverse scenarios, including data analysis or software development. To offer valuable assistance, I require additional details concerning your situation, including the specific software or tool you're utilizing, the precise error message or problem you're facing, and any pertinent information about your analysis or project. For more information, please check here.