Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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 !
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)
Hello !
You can try this :
sum({<[Pack Sales Start Date]= {"<$(=($(vPeriod)))"}>}[€ PUB])
Enjoy your Qlik.
Kind regards,
Théo ATRAGIE.
hi Theo,
that doesn't work, that gives me a "less or equal" when I need a strictly less than.
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!
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?
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!
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)
hi Marcus,
indeed it was a simple if, many thanks for that 😊, I didn't think about it!