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

Create listbox based on calculations

Hello,

Is it possible to create a listbox based on measures(expressions) in  a graph

Lets say

I have sum(sales) and sum(budget) in a graph.

Can i then make a listbox, where i can select Sum(sales) and sum(budget)

So when i select these, only the one i select will be shown in my graph....

1 Solution

Accepted Solutions
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Thomas,

     Create a inline table with two fields for example.

     Expression:

     Load * inline [

     Expression

     Sales

     Budget

     ];

     Use this field as filter.

     Then in chart expression use the "Conditional" option, where you can write the logic to show the Sum(Sales) when Sales is selected in Expression field and so on.

     Hope the logic is clear.

Regards,

Kaushik Solanki

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

View solution in original post

9 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi Thomas,

     Create a inline table with two fields for example.

     Expression:

     Load * inline [

     Expression

     Sales

     Budget

     ];

     Use this field as filter.

     Then in chart expression use the "Conditional" option, where you can write the logic to show the Sum(Sales) when Sales is selected in Expression field and so on.

     Hope the logic is clear.

Regards,

Kaushik Solanki

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

I Follow you.

But what would you write in your conditional?

How do you in your conditional refer to Sales under Expression??

Not applicable
Author

something like this:

WildMatch(Concat(Expression, ' / '), 'Sales') ?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Say for example.

    

     Your conditional Expresison will be (for Sales expression)

     =if(wildmatch(GetFieldSelections(Expression),'Sales'),1,0)

     and for Budget it will be

     =if(wildmatch(GetFieldSelections(Expression),'Budget'),1,0)

Regards,

Kaushik Solanki

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

If i use wildmatch do i have to write the whole name? or is there something like in SQL where you can use % so i dont have to write the whole name..

Lets say if i write 'Sal' instead of Sales do i then need some kind of prefix?

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Yes wildmatch is same like 'LIKE' in sql.

     With wildmatch function you can use the '*' same like '%' in like function.

     You need to write 'Sal*' for sales.

Regards,

Kaushik Solanki

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

btw. one last questions. If i do this, i can only select one at the time. What if i want to select two? then it says All expressions disabled!

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

     Try *Sal* in wildmatch.

Regards,

Kaushik Solanki

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

Cheers!