Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro for dynamic chart: Choose only some of the dimensions

There has  been a good template made by Jason: http://community.qlik.com/qlikviews/1077

However, if we chose to use a more than one dimension, how can we set the order of the dimensions? (First, second dimension ...)

I would have replaced this expression:

set dimSelection = ActiveDocument.fields("%Dimension").GetSelectedValues

with another one:

    set dimSelection(0) = "forecast_provider"

    set dimSelection(1) = ActiveDocument.fields("%Dimension").GetSelectedValues

    set dimSelection(2) = "forecast_time"

However, it does not work. Any ideas?

Best,

Jonas

1 Solution

Accepted Solutions
Not applicable
Author

Thanks Ashok for your question!

It was better, to use a new variable showDim, and then add a calculated dimension:

=if(showDim=2, function(....foobar2...),

if(showDim=3, function(....foobar3...),

if(showDim=4, function(....foobar4...),

if(showDim=5, function(....foobar5...),

              function(....foobar6...)

))))

Where function(....foobar6...) stands for any function, such as if, sum, etc.

Cheers,

Jonas

View solution in original post

2 Replies
Anonymous
Not applicable
Author

Hi johahall

     Please give me some clear details about your problem

Regards

Ashok

Not applicable
Author

Thanks Ashok for your question!

It was better, to use a new variable showDim, and then add a calculated dimension:

=if(showDim=2, function(....foobar2...),

if(showDim=3, function(....foobar3...),

if(showDim=4, function(....foobar4...),

if(showDim=5, function(....foobar5...),

              function(....foobar6...)

))))

Where function(....foobar6...) stands for any function, such as if, sum, etc.

Cheers,

Jonas