Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can we use expressions from Excel in the chart???

Can we use expressions from Excel in the chart?.....

Suppose i hav an excel containing two fields

Selection Expression
CMC sum(Sales)
Product count(Product)
...................................
..............................
Im using only one dimension for example : Customer.

The Data modelling also having the fields Sales and Product

Now i want to use the expressions from the Excel in the chart .

when i select CMC in the field Selection the expression sum(Sales) should show the result for the dimension Customer.

Similarly for Prodcut the expression count(Product) should show the result.so on..

Can we Map the Fields Sales and Product in the data modelling to the Expression field values Sales and Product ( from Excel)..

regards

Ashok Kumar J

1 Solution

Accepted Solutions
Not applicable
Author

I have tested this but I don't think you can use the value from your Excel sheet as a chart expression. I can't get it to see the value as an expression. The chart just displays =sum(Sales) instead of the expression result.

Maybe you can try the following:

  • Define the expression(s) as variable(s)
  • Put the variable(s) in an input box. You can let the end-user change the expression in this inputbox. You can also put buttons on the screen which apply the different expressions on click, changing the chart.
  • Using the variable in the expression ( $(variablename), for example =sum($(variablename)) should make the chart update every time the variable is changed.

Regards, Sander

View solution in original post

8 Replies
Not applicable
Author

Hi Ashok,

When you transform (rotate it in the Table Files wizard) your Excel sheet making CMC and product fieldnames and the expressions values you can link these fields to the ones in your datamodel. Then you can use the expression values as value linked to you customer dimension.

Is this what you mean?

Regards, Sander

Not applicable
Author

No. We cannot link the Excel to the data model, becoz it has expressions from diff tables..

i want to know whether we can use expreesion from excel in the chart?

Regards

Ashok Kumar

Not applicable
Author

Ok.. So you want to load a value as an expression.. Can't you just say

= IF([Selection]='CMC', ' = ' & [Expression])

in your chart expression?

Sander

Not applicable
Author

Hi

U didnt get wat i say....

Im going to use an Excel for some expressions in the chart. so that the End User can change only the expression in the excel instead of going into the chart and add expression. so the Sales in sum(Sales) cannot be linked to the Field in the data model field Sales. it is treating it as text instead of field.

Regards

Ashok Kumar

Not applicable
Author

I have tested this but I don't think you can use the value from your Excel sheet as a chart expression. I can't get it to see the value as an expression. The chart just displays =sum(Sales) instead of the expression result.

Maybe you can try the following:

  • Define the expression(s) as variable(s)
  • Put the variable(s) in an input box. You can let the end-user change the expression in this inputbox. You can also put buttons on the screen which apply the different expressions on click, changing the chart.
  • Using the variable in the expression ( $(variablename), for example =sum($(variablename)) should make the chart update every time the variable is changed.

Regards, Sander

Not applicable
Author

Extract the 2 fields selection, expression from the excel.

This become independent table.

Write the macro to achieve this. You can get the help from the API guide for dynamically Add/Removing expression and dimension on chart objects.

Map that macro agaist OnSelect of "selection" field from the menu Settings -> Document properties -> Macro tab.

Not applicable
Author

Hi all

we got the solution.. Thanks Sander & Yoga for ur responses..

It works.. even without using macro...

Assiging the field Expression (from Excel) to a Variable inside the application and then

using the Variable inside the chart by $(Variable) worked .

Regards

Ashok Kumar J

Karl_Humma
Employee
Employee

See attached file.

/Karl