Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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
Hi Srinivasan
Kindly provide me .qvw example file.
Regards
Ashish Srivastava
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.
I can not understand your example qvw file.
kindly requested to you please explained me detailed.
Regards
Ashish srivastava
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 ?
where you macro i not understand.
Regards
Ashish
Open the Document, use the Shortcut key "Ctrl+M". You can find the macro.
Sorry now we understand whole process .
Thanks a ton.
Regards
Ashish Srivastava