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

Passing the first dimension to Aggr function or Total function in set in pivot chart ?

Hii folks,

Suppose i am having 3 dimensions in a pivot chart as zone,region,branch and i m show sum(sales) as expression.

Now i want to add another expression - something like

aggr(NODISTINCT sum(Sales),(FirstDimension))

or

sum(TOTAL<FirstDimension> Sales)

i.e if Zone is the first dimension of the chart output should be zone wise totals , if users drags the dimension and makes region as the first dimension in the chart then output should be Regionwise totals.

Is this possible ?

Any help would be appreciated.

Thanks,

Rohan

jagan

1 Solution

Accepted Solutions
Not applicable
Author

Hello both,

i finally found a dynamic solution to this requirement without the use of input box or variables -

sum(TOTAL<$(=GetObjectField(0,'CH24'))> Sales)

or

aggr(NODISTINCT sum(Sales),$(=GetObjectField(0,'CH24')))

Thank you for your solutions as well.

Regards,

Rohan

View solution in original post

14 Replies
sunny_talwar

I don't think this would be possible. A not so efficient work around would be to have overlapping charts which hide show based on button may be where each chart have one of the dimension as the first dimension.

Anonymous
Not applicable
Author

Agreed with you Sunny...

But one thing, If this scenario comes in Adhoc Reporting, where user will be picking the dimension you dont think using variables and FieldSelection combination and we can make it dynamic.

I mean to say, I am putting the First selected value of dimension into a variable and then using that variable in grouping..

Is this not possible?

sunny_talwar

It might work. Will have to be tested out.

Not applicable
Author

I am having Adhoc reporting itself , and in the scenario mentioned by you what if a user selects more than 1 dimension in adhoc , in such case how will qlikview identify which is the first selected Dimension that should be passed to the variable ?

Anonymous
Not applicable
Author

I think, this is what Rohan is asking..

As per him

i.e if Zone is the first dimension of the chart output should be zone wise totals , if users drags the dimension and makes region as the first dimension in the chart then output should be Regionwise totals.

Not applicable
Author

yes u are correct balraj.

What i want is something like -

aggr(NODISTINCT sum(Sales),getobjectfield(0)))

-GetObjetcfield(0) gives me the name of my first dimension,however i am not able to pass it to AGGR fuction as a dimension.

sunny_talwar

I guess you were right. It can work. Try it out Rohan Rane

Capture.PNG

Selection in vDim1 will drive the output of the second expression here (=Sum(TOTAL <$(vDim1)>Value))

Thanks balrajahlawat‌ for forcing me to reconsider.

Anonymous
Not applicable
Author

Did not force you. Just shared my thoughts with you

sunny_talwar

Your thoughts forced me to reconsider , how about that?