Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

What's the meaning of Dimension=$::Dimension in sum(aggr())

Hello, Dear Friends

I get an old app done by someone who has left my team, for example below.

I tried google, bing and community searching, but no good answers for me.

Could anybody help me to understand what does it mean of Dimension=$::Demension?

Thank you.

SUM(aggr(

sum({1<[Article Hierarchy 1]=$::[Article Hierarchy 1],[Article Hierarchy 2]=$::[Article Hierarchy 2],[Article Hierarchy Range]=$::[Article Hierarchy Range],[Section]=$::[Section],[Category]=$::[Category],Post_Year={'$(varPreviousYear)'},Country={'China'}>} total<Category,Diameter> Tons)

/sum({1<[Article Hierarchy 1]=$::[Article Hierarchy 1],[Article Hierarchy 2]=$::[Article Hierarchy 2],[Article Hierarchy Range]=$::[Article Hierarchy Range],[Section]=$::[Section],[Category]=$::[Category],Post_Year={'$(varPreviousYear)'},Country={'China'}>} total Tons)

,Category,Diameter,Post_Month

))

5 Replies
petter
Partner - Champion III
Partner - Champion III

Dimension=$::Dimension will only give much meaning when the chart that this entire expression resides in belongs to an Alternate State.

In such a context the dimension of an Alternate State will be assigned the selections from the dimension in the normal/standard state. The $ denotes the standard or normal selection state when it occurs before two semicolons. Instead of the $ another named ID for an alternate state could be used. This would be a developer/user created alternate state.

Since you are posting this in a Qlik Sense group I guess that you have a QlikVikew application that has this expression and you want to get it converted to a Qlik Sense application. If that is the case you should know that Alternate states are not implemented in the standard chart/table types of Qlik Sense although the developer API and the Qlik Inference Engine and Calculation Engine supports this. Meaning that is hard for you to translate this from a QlikView application into something very similar in a Qlik Sense applcation.

The QlikView reference: https://help.qlik.com/en-US/qlikview/November2017/Subsystems/Client/Content/Alternate%20States.htm

Anonymous
Not applicable
Author

Thank you, Petter.

You are right this formula was copied from qlikview. So...

I think I have to talk with business for the logic and rewrite entire formula in qlik sense.

petter
Partner - Champion III
Partner - Champion III

You can get some of the same effect by using:

  1. Bookmarks with the selections that you want to select against
  2. Create Data Island tables to "emulate" alternate states. Your expressions will not need to be very different actually. It does require duplication of all the dimensions that you need to use on the right-hand-side of the set expressions.
  3. Use the $1 and $2 identifiers to make "Comparative Analysis" ... however this requires more displine for the end-users to do it correctly - although it is quite straight-forward once they get the grips of it.
  4. There are extensions on Qlik Branch that can help you implement Alternate States - they have been reported to not always work 100% ... I haven't tried them myself though...

Alternate States are most often used for Comparative Analysis. However there are other ways like I mentioned to do the comparative analysis...

sunny_talwar

Dimension=$::Dimension will only give much meaning when the chart that this entire expression resides in belongs to an Alternate State.

Petter, I don't completely agree with this, but correct me if you think I am wrong.

I think this can also be used in an inherited state when used with 1 to ignore selection... which the above expression is doing

SUM(aggr(

sum({1<[Article Hierarchy 1]=$::[Article Hierarchy 1],[Article Hierarchy 2]=$::[Article Hierarchy 2],[Article Hierarchy Range]=$::[Article Hierarchy Range],[Section]=$::[Section],[Category]=$::[Category],Post_Year={'$(varPreviousYear)'},Country={'China'}>} total<Category,Diameter> Tons)

/sum({1<[Article Hierarchy 1]=$::[Article Hierarchy 1],[Article Hierarchy 2]=$::[Article Hierarchy 2],[Article Hierarchy Range]=$::[Article Hierarchy Range],[Section]=$::[Section],[Category]=$::[Category],Post_Year={'$(varPreviousYear)'},Country={'China'}>} total Tons)

,Category,Diameter,Post_Month

))

What this is doing is ignoring all selections (because it has 1) in all fields except the ones which uses Dimension = $::Dimension.

petter
Partner - Champion III
Partner - Champion III

Yes - I agree with you ... I didn't think about that when I gave a response - thank you for making us aware of that!