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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Variable in Diagram-Expression

hi,

is it possible to define an expression of an diagram as variable?

10 Replies
Not applicable
Author

Hi

Sorry, but I'm really not sure what you are asking here, what is it that you want to do? Can you post an example of a doc that's not working?

Cheers,

rbecher
MVP
MVP

..just store a formula in a variable or table.

Var1 = "=sum(value)"

- Ralf

Astrato.io Head of R&D
Not applicable
Author

See attached

1. I created a variable called vFormel which changes according to what you are selecting in the list box for Formel (check the variables in Settings, Variables). I then created another copy of your pivot which is using this variable.

2. I created a variable with =Sum(Wert) as the content and then created a further copy of your pivot that uses this variable.

Hope this helps,

rbecher
MVP
MVP

..did the wrong upload. Now the example is attached.

Astrato.io Head of R&D
Not applicable
Author

.....so now Im completely confused, it looks to me like you have it working!!

Can you explain what you need to do with this now?

rbecher
MVP
MVP

..two different approaches. In my example user can edit expression, in your example use can select it.

- Ralf

Astrato.io Head of R&D
Not applicable
Author

i've got a datatable like this:

id, group, value

1, a, 10

2, a, 5

3, a, 8

4, b, 1

5, b, 8.3

6, b, 0

in my diagram i wanna sum all values which are in group a and average all values in group b in the same column.

so the expression can look like this

if(group='a', sum(value), avg(value))

in my case i have many groups. so it would be fine to add a second datatable:

group, expresssion

a, sum(value)

b, avg(value)

and use the field "expression" to define the expression of the diagram.

rbecher
MVP
MVP

Frank,

I don't think it's possible to have different aggregation functions in one column.

- Ralf

Astrato.io Head of R&D
johnw
Champion III
Champion III

You can have different aggregation functions in one column, and with the exact data and expression Frank mentioned.