Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

Not applicable

VBScript with Straight Table

Hello All,

Is it possible to load a Straight Table cell value into a variable?

Thanks!



Tags (2)
5 Replies
MVP
MVP

VBScript with Straight Table

Hello and welcome to the Forums,

Rather, you can set the expression you used in the straight table into a variable or in a text object. Say you have a chart showing Country as dimension and Sum(Sales) as expression. If it's one particular value of the dimension what you want to show, create a variable with something like

Sum({< Country = {'ES'} >} Sales)


Hope that helps.

MVP
MVP

VBScript with Straight Table

Sorry,

You mean using macros? Then this should work:

Sub GetCell Set st = ActiveDocument.GetSheetObject("CHXX") '' ID of the straight table stc = st.GetCell(1, 2) '' First row second columnEnd Sub


Hope that helps.

Not applicable

VBScript with Straight Table

Thanks Miguel!

That's what I'm looking for.

And how can I use the 'stc' value outside the Edit Module and include it in an Expression in a TextBox for instance?

I'm a newbie Smiley Happy



MVP
MVP

VBScript with Straight Table

Hi,

Glad to help. Try with this

Sub GetCellAndSetText Set st = ActiveDocument.GetSheetObject("CHXX") '' ID of the straight table stc = st.GetCell(1, 2) '' First row second column (including subtotal, if any) Set t = ActiveDocument.GetSheetObject("TXXX") '' ID of the text object t.SetText stc.TextEnd Sub


Hope that helps.

Not applicable

VBScript with Straight Table

Thanks a lot Miguel!

Community Browser