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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Listbox with artificial values

Hi there,

I have got the following problem:

in my qlikview file I show the sales over time. I want the user to be able to select if refunds are included or not.

The effect would be, that in the sum rows with the status = 'refund completed' will be included.

I thought about using a listbox with the values 'Including Refunds', 'Excluding Refunds' and made this listbox with ValueList but i wasn't able to select a value (and I wasn't sure what to specify in GetFieldSelection? ).

Thanks in advance!

1 Solution

Accepted Solutions
swuehl
MVP
MVP

I wouldn't use a synthetic dimension (Valueslist) for this, better use a data island table:

LOAD * INLINE [

GraphsInCharts

GraphA

GraphB

GraphC

GraphD

GraphE

];

Use the field GraphsInCharts in a list box to select your graphs. Then you can check your selections in that field to conditionally enable the graph in your chart.

View solution in original post

7 Replies
swuehl
MVP
MVP

How do you tell that refunds are included or not? Do you have a field with that information?

Then you could use something like

=if( RefundIncludedField = 1, 'Including Refunds', 'Excluding Refunds')

But probably it is not as easy as this. Then you should describe your setting a bit closer (data model, how fields are linked, how you retrieve the refunds status information from your data).

A ValueList() creates a synthetic dimension, not linked to your data model, so it's probably quite hard to use it in this scenario (can't tell, because I don't really  know your setting).

Not applicable
Author

Thank you for the answer!

Ok so basically i have a table containing all orders in which there is a status flag which can have the values

'completed' or 'refund_completed'

If refunds shouldn't be included, only the orders with the status 'completed' are part of the calculation.

If refunds should be included, all the orders with status 'completed' AND status 'refund_completed' are part of the calculation.

Isn't it possible to create a listbox with ValueList and then set a variable with that specific value selected in this listbox?

swuehl
MVP
MVP

Could you post some sample lines of your data?

As I understood, you need to look at different / multiple records per order. Then check the status on all records per order?

I am not sure if you can use a ValueList here, I just believe it will probably make things more complicated.

But could you post your idea with the ValueList here, as list box field expression (even it does not work yet)?

Not applicable
Author

Ok, I figured out, that in this case it was not really necessary to create a listbox with artificial values. I simply created a listbox with the values of the field status.

But now I have a similar problem which needs artificial values in listboxes I think:

Currently I have 5 graphs in one chart. The user should be able to show/hide the graphs via selection in a listbox.

Is this possible? thanks in advance!

Not applicable
Author

1. create a variable

2. in chart properties check under expressions for conditional set it to varibel =x

swuehl
MVP
MVP

I wouldn't use a synthetic dimension (Valueslist) for this, better use a data island table:

LOAD * INLINE [

GraphsInCharts

GraphA

GraphB

GraphC

GraphD

GraphE

];

Use the field GraphsInCharts in a list box to select your graphs. Then you can check your selections in that field to conditionally enable the graph in your chart.

Not applicable
Author

Thank you!

Just another hint:

In the conditional expression for the graph I had to use Concat when I wanted more than one graph to be shown:

Index(CONCAT(GraphsInCharts), 'GraphA') > 0