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

Dynamic Chart - Expression, Number Format Problem

Dear Friends,

I'm currenlty Creating a report, using the Dynamic Concept.

I find a problem while using the Expression.

I'm using this "Dynamic Chart" posted in this discussion "http://community.qlik.com/forums/t/23852.aspx?PageIndex=1".

When i calculate the Expression in the Expressions, the default number format is displayed in the Report.

I some how managed to change the Format for Few expressions, but i can't able to do for Some expressions.

Example I can do for Sum(Cost), Sum(Ton). But not for the Sum(Cost)/Sum(Ton).

How i handle for Sum(Cost) and Sum(Ton). While loading the Data, i change the format for Cost and Ton i.e., Using the Num().

But i can't use the same for Cost/ton.

Please Help Me to solve this issue.

Thanks in Advance.


Regards,

R.Srinivasan.

1 Solution

Accepted Solutions
Not applicable
Author

I have managed to solve by using a macro.

Here is the macro.

set chart = ActiveDocument.Sheets("Main").CreateStraightTable

chart.AddDimension "ProductType"

chart.AddExpression "sum(Amount)"

set p = chart.GetProperties

set np = p.Expressions.Item(0).Item(0).Data.ExpressionVisual.NumberPresentation

np.Dec = "."

np.Fmt = "# ##0.00"

np.nDec = 2

np.Thou = " "

np.Type = 11 'fixed decimal

np.UseThou = 1

chart.SetProperties p

View solution in original post

8 Replies
Not applicable
Author

I have managed to solve by using a macro.

Here is the macro.

set chart = ActiveDocument.Sheets("Main").CreateStraightTable

chart.AddDimension "ProductType"

chart.AddExpression "sum(Amount)"

set p = chart.GetProperties

set np = p.Expressions.Item(0).Item(0).Data.ExpressionVisual.NumberPresentation

np.Dec = "."

np.Fmt = "# ##0.00"

np.nDec = 2

np.Thou = " "

np.Type = 11 'fixed decimal

np.UseThou = 1

chart.SetProperties p

Not applicable
Author

Hi Srinivasan

Kindly provide me .qvw example file.

Regards

Ashish Srivastava

Not applicable
Author

Hi Ashish,

Here i have attached the sample qvw. It contains a macro, which create the straight table with a Dimension and Expression, using the Macro detail Number presentation.

Not applicable
Author

I can not understand your example qvw file.

kindly requested to you please explained me detailed.

Regards

Ashish srivastava

Not applicable
Author

Hi Ashish,

If you look at my example, the "Chart.AddDimension" and "Chart.AddExpression", is just to create the chart.

The "p=Chart.GetProperties", get the Chart Properties and "P.Expression" get all the Expressions.

Then the Dec is the demical symbol, Fmt is the Number Format, nDec is the Decimal Places, Thou is the Thousand separator etc.

Is this clear ? or do you expect more from me ?

Not applicable
Author

where you macro i not understand.

Regards

Ashish

Not applicable
Author

Open the Document, use the Shortcut key "Ctrl+M". You can find the macro.

Not applicable
Author

Sorry now we understand whole process .

Thanks a ton.

Regards

Ashish Srivastava