Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Automatic Month Selection

Hi all,

I have to following issue:

I have a selection box of month names and data for the targets for each month. The first month of the financial year has a base target number and each month after that has the total increase of the target. ie if July has a target of 100 and June's target is 150, June has a target of 50. The final target value is calculated by adding all the targets together.

Say a user selects November, I need the selection go automatically select all months prior to November as well.

If a user selects months that do not include the first month of the financial year the target will not calculate correctly. What I need is a way to take to highest month a user selects and add up all the target values up to that month. Is there a simple way to do this? I've tried using set analysis but I'm not quite sure how to get all the months up to the highest month selected. I'm totally stumped!

Any help would be greatly appreciated.

Adam

1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

I ended up finding a solution using set analysis. The code I used was:

Sum({<FiscalMonthName = {"<=$(=max(FiscalMonthName))"}, Quarter=,MonthName= >}Target))

The Quarter and MonthName would likely be unique to my environment.

Thanks!

View solution in original post

5 Replies
Not applicable
Author

hi

try this

**

Menu--> Document properties-->Triggers-->Field event Trigger --> selectfield--> onselect-->add action--> field = value, search string = ='>= & <=' & value

see attached file

Anonymous
Not applicable
Author

Hey thanks for the reply Vishwaranjan. I tried what you suggested but it doesn't seem to work. Any explanation as to what the code is doing?

Ideally I'd like to be able to use set analysis to calculate the target and save it in a variable. The reason is that there's 3 different targets for each month and only one of them is set up in the way I explained in my previous post. All the others have a new target each month so I just display the target as is. If I change the selection on screen it will then throw out the other targets... Very frustrating!

Anonymous
Not applicable
Author

I ended up finding a solution using set analysis. The code I used was:

Sum({<FiscalMonthName = {"<=$(=max(FiscalMonthName))"}, Quarter=,MonthName= >}Target))

The Quarter and MonthName would likely be unique to my environment.

Thanks!

Not applicable
Author

Please try the attached qvw.

Anonymous
Not applicable
Author

Thanks for that Ramkumar. It is slightly different to what I ended up using but would work as well.