Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Selections count and value computation

Hi

I have a scenario,

where if a date is selected from multibox, my set analysis should include that date and all datest less than that.

Date               x

1/1/2011          5

1/2/2011          8

1/3/2011          10    

1/4/2011          12

1/5/2011          14

So when the user selects 1/4/2011 then I need to set the sum of a columns X. for dates 1/4/2011 and all dates less than 1/4/2011

if the user selects more than one selection from the multibox, then sum of X only for the selected dates should be computed.

If user selectes only one date 1/4/2011 then value computed should be Y = (5+8+10+12) = 35

If the user selects more than one date like, 1/1/2011 and /1/5/2011 then Y = (5+14) = 19

How can I achieve this? Please advice

1 Solution

Accepted Solutions
Not applicable
Author

OK, I was missing the equal sign. Try this:

sum( {$<Date={"<=$(=max(Date))"}>}  X )

View solution in original post

7 Replies
Not applicable
Author

Well, for the first you can use:

sum( {$<Date={"<=$(max(Date))"}>}  X )

I don't know if it'll work for the second requirement.

Not applicable
Author

Hello Carlos,

Thanks for responding.

I tried the solution provided by you for 1, It does not seem to calculate it right, It simply behaves like ignoring Date

like Date=>

Not applicable
Author

It can be due to several causes, can you post a qvw to help you?

Not applicable
Author

OK, I was missing the equal sign. Try this:

sum( {$<Date={"<=$(=max(Date))"}>}  X )

Not applicable
Author

Hi Carlos,

Thanks a lot, that did the magic.

Not applicable
Author

This will do both requirements:

=if ( count(distinct Date)=1, sum( {$<Date={"<=$(=max(Date))"}>}  X ), sum(x))

Not applicable
Author

Hi Carol,

Thank You for your reponse, and for the solution for the complete problem.

I was working on an important assignment and was stuck here, Thanks

am able to proceed.