Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Delphines
Contributor III
Contributor III

Set Analysis, strictly less than a variable not working

hi everyone, 

I don't succeed to have a set analysis with a strictly less than a variable working. 

My formula is as follow: 

sum({<[Pack Sales Start Date]= {"<$(=$(vPeriod))"}>}[€ PUB])

result is 0

I tried this one: 

sum({<[Pack Sales Start Date]= {"<=$(=$(vPeriod))"}>}[€ PUB])

but that gives me a "less or equal than" which I don't want.

I also tried this: 

sum({<[Pack Sales Start Date]= {"<$(=vPeriod)"}>}[€ PUB])

which still gives 0.

vPeriod = max(Period)

 

thanks a lot for your help !

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer

I assume from your answer that the variable itself returned a valid value - but of course only one for the entire application not n ones in regard to the object-dimensionalities. Further set analysis is working on a column-level which also means that only a single value is possible.

If you want to compare both dates in the object against each other on a dimensional-level you will to use an if-loop, like:

if(Date1 < Date2, expr1, expr2) 

View solution in original post

6 Replies
theoat
Partner - Creator III
Partner - Creator III

Hello !

You can try this :

sum({<[Pack Sales Start Date]= {"<$(=($(vPeriod)))"}>}[€ PUB])


Enjoy your Qlik.

Kind regards,
Théo ATRAGIE.

Delphines
Contributor III
Contributor III
Author

hi Theo, 

that doesn't work, that gives me a "less or equal" when I need a strictly less than. Capture d’écran 2024-06-14 175101.png

 

 the figures in green should be equal to 0 (example : when Period = 0/05/02018 and Pack Sales Start Date = 01/05/2018 then the condition (strictly less) is not fulfilled, we shouldn't see any sales).

thanks!

marcus_sommer

Just remove the label for this expression and then hoover with the mouse on it - within the showing popup you will see your expression and there the resolved result of your variable. Does the variable have really the expected value?

Delphines
Contributor III
Contributor III
Author

hi Marcus, 

I just noticed that when I select a Period, this is working. But I need to have it work without making any selection, e.g. having the above chart with 0 as sales when Pack Sales Start Date = Period. 

Maybe the variable is not the proper way to do it? 

thanks!

marcus_sommer

I assume from your answer that the variable itself returned a valid value - but of course only one for the entire application not n ones in regard to the object-dimensionalities. Further set analysis is working on a column-level which also means that only a single value is possible.

If you want to compare both dates in the object against each other on a dimensional-level you will to use an if-loop, like:

if(Date1 < Date2, expr1, expr2) 

Delphines
Contributor III
Contributor III
Author

hi Marcus, 

indeed it was a simple if, many thanks for that 😊, I didn't think about it!