Qlik Community

New to Qlik Sense

Discussion board where members can get started with Qlik Sense.

Announcements
Qlik® Product Spotlight: Discover what’s possible. Get more from our products.
See for yourself. Register today.
ramanannad
New Contributor III

Variable in set analysis TOTAL

Hi,

I have a requirement to have dimension toggle or alternate dimension in Pivot table of QlikSense. So I loaded the possible dimension values in a inline load and use it as a field to dynamically toggle dimension:

So this is how my calculated Dimension looks like:

if(getselectedcount(Dimension)=0,Region,

if(getfieldselections(Dimension)='Region',Region,

if(getfieldselections(Dimension)='State',State)))

Problem with this is, in my set analysis I am TOTAL'ing the values based on the dimension as such :

num((Sum(BASE_MSISDN)/Sum(total <Dimension> BASE_MSISDN)),'#,##0.00%')

*To get the share

With this dynamic dimension toggle, it fails as there isn't a single dimension I can specify in the red area above. Tried using a variable that captures the values in the inline field "Dimension" but this fails as well. Any suggestion on how to tackle this?

Hope the above is clear and seeking all the guru's of Qlik to help me out here

Thanks

Ram-Malaysia

1 Solution

Accepted Solutions

Re: Variable in set analysis TOTAL

How about this:

Num((Sum(BASE_MSISDN)/Sum(TOTAL <$(=If(GetSelectedCount(Dimension) = 0, 'Region', If(GetFieldSelections(Dimension) = 'Region', 'Region', If(GetFieldSelections(Dimension) = 'State', 'State'))))> BASE_MSISDN)),'#,##0.00%')

6 Replies

Re: Variable in set analysis TOTAL

Try this

Num((Sum(BASE_MSISDN)/Sum(TOTAL <$(=if(getselectedcount(Dimension)=0,Region, if(getfieldselections(Dimension)='Region',Region, if(getfieldselections(Dimension)='State',State))))> BASE_MSISDN)),'#,##0.00%')

ramanannad
New Contributor III

Re: Variable in set analysis TOTAL

Hi Sunny,

Unfortunately this does not work. I think its the way we call the IF clause there.

Thanks

Ram

Re: Variable in set analysis TOTAL

How about this:

Num((Sum(BASE_MSISDN)/Sum(TOTAL <$(=If(GetSelectedCount(Dimension) = 0, 'Region', If(GetFieldSelections(Dimension) = 'Region', 'Region', If(GetFieldSelections(Dimension) = 'State', 'State'))))> BASE_MSISDN)),'#,##0.00%')

Re: Variable in set analysis TOTAL

Or just this:

Num((Sum(BASE_MSISDN)/Sum(TOTAL <$(=If(GetSelectedCount(Dimension) = 0, 'Region', GetFieldSelections(Dimension)))> BASE_MSISDN)),'#,##0.00%')

ramanannad
New Contributor III

Re: Variable in set analysis TOTAL

This is brilliant....thanks Sunny :-)

Re: Variable in set analysis TOTAL

Not a problem, I am glad I was able to help