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

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select multiple values in a listbox, hot to take it?

Hi everyone,

I have a problem with my expression.

Now this expression works perfectly (thanks to haneesh):

sum({<YEAR ={$(=max(YEAR))},Month={$(=Only(Month))}>}Budget)

but if I select more than one Month it doesn't work (example I select Jan & Feb).

Only(Month) take "only" one value per time.

How can I change my expression to solve this problem?

Thanks a lot

7 Replies
Not applicable
Author

Hi guys,

I solved my problem.

My new expression is:

sum({<YEAR ={$(=max(YEAR))},Month={$(=GetFieldSelections(Month))}>}Budget)

Thanks a lot

Not applicable
Author

Hi again,

new problem with the expression.

The GetFieldSelections expression works properly if you select max 6 values.

It gives us 01,02,03,04,05,06 if we select from 01 to 06, BUT if we select:

01,02,03,04,05,06,07

it gives us:

NOT 08,09,10,11,12

and obviously it doesn't work with $(=GetFieldSelections(Month)).

Any idea to solve this problem ??

Thanks a lot

Not applicable
Author

I'm sorry,

I have only to pay more attention.

The new expression is:

sum({<YEAR ={$(=max(YEAR))},Month={$(=GetFieldSelections(Month,',',12))}>}Budget)

',' is the delimiter between selected values

12 is the highest number of individual values that will be displayed

Thanks a lot

erichshiino
Partner - Master
Partner - Master

HI,

In your case, can't you just use

sum({<YEAR ={$(=max(YEAR))}}>}Budget) ?

Not applicable
Author

Hi,

I need to use Month too otherwise it doesn't work properly.

Thanks a lot for you reply

gandalfgray
Specialist II
Specialist II

I agree with Erich,

it seems you are "overusing" set statements.

Why do you need to use a set expression to select in Month exactly what the user have manually selected in Month??

Not applicable
Author

Both of you are right but I have to use that expression because of my cloud.

I need to refer to different "period" that are on different table (it's difficult to me to explain)

I tried to use only

sum({<YEAR ={$(=max(YEAR))}}>}Budget)

but it doesn't work properly.

Our customer works in a strange way and we had to build our cloud in this way.

I'm new on QlikView and I'm sure I can do better than now.

I'll try to think a different way to build our cloud to avoid this case.

THANKS A LOT for your help.

I really appreciated.