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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Dynamic expression calculation

Hello all,

I have a table with few dimensions

I like to add to this table 1 expression, this SUM function.

I like the SUM to be based on another selection that I made.

For example:

Dimensions = date and Customer

Expression = sum(From Button)

I create new button that once pressed it select some values

So I like this selection to be display in my table.

Now if I create second button, once it’s been selected, thedata in the table will be updated with the new selection.

At the end I will have 1 table with few dimensions and 1expression that is calculated based on button selection.

Thanks in advance.

1 Solution

Accepted Solutions
Not applicable
Author

Here you go. Create a variable from Settings/Variable Overview.

In the button add an action, External, Set Variable. Endter variable name at the top and the value you want to set.

View solution in original post

6 Replies
Luis_Cortizo
Employee
Employee

I think I have not understood you...

So you have two buttons that make selections and want your chart to reflect the results of some calculations for the selections made... that's the standard behaviour in QlikView... there's no need to do anything.

Could you provide more detail or even a document with an example of what you want to do?

Not applicable
Author

Let’s say this is the table that I have:

                                               

 

customer name

 
 

type

 
 

units

 
 

defect

 
 

A

 
 

A1

 
 

1

 
 

1

 
 

A

 
 

A2

 
 

5

 
 

2

 
 

A

 
 

A3

 
 

7

 
 

4

 
 

A

 
 

A4

 
 

9

 
 

5

 
 

A

 
 

A5

 
 

12

 
 

4

 

I like to create a table with 2 dimensions – ‘customer name’and type

1 have only 1 expression it should by SUM()

I like the sum() to by calculated based on the button that I’mselecting

I have 1 button that select “units” and on button thatselect “defect”

I know that if I select one of the dimensions, let’s say “A1”it will be reflected in the table.

I like the selection to be reflected in the expression,

Having 1 expression that changes dynamically by selecting specific button.

I hope its clearer.

Thanks again.

Not applicable
Author

Create a variable. Set the buttons to change the variable to whatever field you want to summarize.

Place the variable in the sum.

Sum($(Field))

Not applicable
Author

thanks for your feadback.

Do you have an exmple for that?

i never set variable before.

Not applicable
Author

Here you go. Create a variable from Settings/Variable Overview.

In the button add an action, External, Set Variable. Endter variable name at the top and the value you want to set.

Not applicable
Author

Thanks a million