Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
jagannalla
Partner - Specialist III
Partner - Specialist III

How to use field value as chart expression

Hi,

I want to convert my chart expression into field value. How can I plot field value as chart expression ?

For eg:

I've data in the below format 

 

LOAD

* INLINE

[
Val
10
20
30
]

;

LOAD

* INLINE

[
Dim1, Expression
G1, Min(Val)
G2, Max(Val)
]

;

- Now in straight table I'll add Dimension as Dim1.

- In expression I need the expression what we had for each dimension value.

G1 - Min(Val)

G2- Max(Val)

- I know that we can put if condition in expression tab as =If(Dim1 ='G1',Min(Val),Max(Val)), but I don't want to control in expression tab. I want to control using field value i.e. the value of field will be expression.

How can I do this.

Thanks,

Jagan

7 Replies
MK_QSL
MVP
MVP

Like this ?

jagan
Luminary Alumni
Luminary Alumni

Hi,

Try this

Regards,

Jagan.

jagannalla
Partner - Specialist III
Partner - Specialist III
Author

But Min and Max value is giving wrong answer

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Use Dim1 as the chart dimension and $(=Expression) for the chart expression.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
jagannalla
Partner - Specialist III
Partner - Specialist III
Author

I had used this exp right now

= Pick(Rno,Min(Val),Max(Val))

It is working, but how to control using field value.

Jonatham - I already tried it but no use.

anlonghi2
Creator II
Creator II

Hi Jagan,

try this approach:

  1. define a variable named f_Formulas  containing the expression =concat(Expression,',')
  2. define a pivot defining Dim1 as dimension and =pick(if(Dim1='G1',1,2), $(f_Formulas)) as expression

Let me know.

Best Regards

Andrea

rjyadav94
Contributor II
Contributor II

Can you please upload the expression because due to my personal edition i am not able to open the qvw files