Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

collapse function in expression

I am a new qlik view developer and I wonder if there is a way how to give a value in the expression when a dimension is collapsed.

For example, if we have 3 classes (a, b, c), when collapsed against it should appear value (6).

DimensionExpression
a1
b5
c4

when collapsed it has to show:

DimensionExpression
abc6

Thanks in advance and regards,

Stoyan

7 Replies
sunny_talwar

How did you get 6 for abc? It is clearly not the sum of 1+5+4, right? In addition, what is the dimension you are using and what is the expression? Would you be able to elaborate?

Not applicable
Author

Hi Sunny,

Yes, 6 has nothing to do with the sum of the above, it is just a different value. The dimension is cyclic group and the expression I need to build and let's say I will use variable for it.

Thanks

sunny_talwar

So how did you come with 6? How does the two table provided above related to each other?

Not applicable
Author

Hi Sunny,

The idea is that I have three regions - east, west and central. This region I use in the dimensions as column in the pivot table. Against these regions I have some actuals sales performed and I have targets for each region, as well as global target. I am taking the targets by region with variables (against each region I have some target shown, defined by the variable). However, I need to say to QV when the "Region" dimension is collapsed (i.e. we have the global actuals for the sales) to show the global target, which is a different figure.

Hope that this helps.

Thanks,

Stoyan

marcus_sommer

Maybe you used a dimension group "structure" with the fields:

global --> region --> area --> ...

and then you queried which value is displayed, like:

pick(match(getcurrentfield(structure), 'global', 'region', ...),

     sum(TargetGlobal),

     sum(TargetRegion),

     ...)

- Marcus

Not applicable
Author

Hi Marcus,

Thanks for the idea, but it does not work in this case. It has to be using somehow the collapse function. Any ideas on this?

Thanks and regards,

Stoyan

marcus_sommer

Best would be you creates a small example with a few inline-data and a few screenshots or an excel to get an idea how the result should look like and which results you are expecting.

- Marcus