Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Now accepting applications for the Qlik Luminary and Partner Ambassador Programs: Apply by July 6!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis problem

Hi,

I must calculate stock on two given dates. Set analysis are

Sum({1<Date={"<=$(vFirstDate)"}>}Quantity)

Sum({1<Date={"<=$(vSecondDate)"}>}Quantity)

Both results are always same despite different dates.

Any ideas?

TIA

Labels (1)
1 Solution

Accepted Solutions
sunny_talwar
MVP
MVP

How about this?

Sum({1<Date={"<=$(=vFirstDate)"}>}Quantity)

Sum({1<Date={"<=$(=vSecondDate)"}>}Quantity)

or

Sum({1<Date={"<=$(=$(vFirstDate))"}>}Quantity)

Sum({1<Date={"<=$(=$(vSecondDate))"}>}Quantity)

View solution in original post

17 Replies
Anil_Babu_Samineni
MVP
MVP

Can you define variables? Ane can you try from text object with two variables and see how values / Date seems

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Variables are

LetFirstDate = Today();

Let SecondDate = Today();

Variables in a text box are in numeric format

Anil_Babu_Samineni
MVP
MVP

When you say two variables given Today() then what is the use to make of two set analysis.

Variables in a text box are in numeric format

May be change to Date(Today()) -- It will DD/MM/YYYY Format in qlikview

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

Try this ,working fine for me .

=sum({$<Date={"$(vLastDate)"}>}Stock)

=sum({$<Date={"$(vFirstDate)"}>}Stock)

sravanthialuval
Creator
Creator

Try this

Sum({1<Date={"$(='<=' & $(vFirstDate) & '<=' & $(vSecondDate))"}>}Quantity)

Not applicable
Author

That didn't help

Thx anyway

Not applicable
Author

I can't use $ qualifier, must be 1 (all)

Not applicable
Author

Returns zero values and results must be in two separate columns

Anil_Babu_Samineni
MVP
MVP

So then tell me your business logic to give solution. In fact, your set operator is not that much understand

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful