Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

User Date selections for Set Analysis not adequate..need help

I have a Set Analysis expression that works great under strict circumstances.

This sums up a Date Range from Min to the Max Months selected. or Max(RevMonth)

Sum({$<RevMonth={"$(='>=' & Min({$} RevMonth) & '<=' & AddMonths(Min(RevMonth),MonthDiff) )"}>} RevAmt

The problem is if a user selects Non Consecutive months then the calculation is wrong or sums up to much because it does not take into account the 'missing' months.  Is there a better way to handle this situation.?  What I'm I doing wrong ?

Thank You all,

Brian

1 Solution

Accepted Solutions
johnpaul
Partner - Creator
Partner - Creator

I don't let the user select multiple months.

I use a variable and a calendar object to allow the user to select an end date. Then another variable to select the start date.

View solution in original post

6 Replies
m_woolf
Master II
Master II

Can you use max(RevMonth) instead of

AddMonths(Min(RevMonth),MonthDiff)

Not applicable
Author

Yeah I've tried that, but gets me the same result. I may have to provide all the possible month possiblities up to 20 or so. too much work but may require that or force them to only select Consecutive months which is how most would any ways.

johnpaul
Partner - Creator
Partner - Creator

I don't let the user select multiple months.

I use a variable and a calendar object to allow the user to select an end date. Then another variable to select the start date.

Not applicable
Author

I think that is the way I will have to do it to control the data flow into the Expression.

Does it allow user to see whats green,grey white, I guess that implied once selected...

Thank you both for your insights, tips & advice.

Not applicable
Author

Paul, could you upload a sample of this calendar method with variables or point me to a online example.? Thanks!

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Have a look at the attachment.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!