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

Dynamic Variables not changing in Section access for Qlik Sense using getfieldselections

Hi All,

I have implemented section access in Qliksense  with  geo level hierarchy .  The structure of hierarchy is  REGION->Territory->SalesGroup  with  amount as a measure.  Now client want to view the sales in TKL as well as in KL as UOM.

For this we have created a variable  vKLTKL = if( getselectedcount(SalesGroup)  >= 1  or getselectedcount(Customer) >= 1,1,1000)

1 -> KL

1000 -> TKL.

When we reload the app with section access and if we assign a particular sales group to an user and when we open QVF  TKL to KL Flip is not working properly for section access with getselectedcount () function where as same is working fine without section access.

Any idea  why it is not working ?

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
10 Replies
jyothish8807
Master II
Master II

Hi Vikas,

Will it be possible for you to share some sample code ?

As per my understanding you will be doing some selections on Salesgroup and Customers .. right ?

Br,

KC

Best Regards,
KC
vikasmahajan
Author

we are passing SalesGroup or Customers through section access and the value of getselectedcount()  is not changing accordingly that is a issue ! Is there any way or alternate function which will change the values through section access for this parameters ?

Thanks

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
jyothish8807
Master II
Master II

try like this:

if( len(SalesGroup)  > 0  or len(Customer) > 0,1,1000)


Br,

KC

Best Regards,
KC
jyothish8807
Master II
Master II

One reason could be after passing Customer through section access there could be more that one value assigned

or QS do not take that value has selected.

Can you please share your section access code ?

Best Regards,
KC
jonathandienst
Partner - Champion III
Partner - Champion III

GetSelectedCount is based on user selections. Data access reduction will not set selected count. You could use GetPossibleCount() or a simple Count() function.

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
vikasmahajan
Author

Section Access;
LOAD
    //Name,
    "ACCESS",
    "USERID",
    REGION,
    TERRITORY_NAME,
    SALESGROUP_NAME
 
   
   // ROLE
FROM [lib://Lubes_SourceFiles/Lubes Dashboard Section Access.csv]
(txt, codepage is 28591, embedded labels, delimiter is ',', msq);

SECTION APPLICATION;

This  a code for section access and  variable which we have used for flip the TKL to KL is

if((GetSelectedCount(ProductBrand)>=1 or

   getselectedCOUNT(ProductName)>=1 or

       GetSelectedCount(SalesGroupName)>=1 or

GetSelectedCount(CustomerName)>=1

    ),'1','1000')

Please can you guide how to achieve is requirement.

Regards

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
jyothish8807
Master II
Master II

Try this:

if((GetPossibleCount(ProductBrand)>=1 or

   getpossibleCOUNT(ProductName)>=1 or

       GetPossibleCount(SalesGroupName)>=1 or

GetPossibleCount(CustomerName)>=1

    ),'1','1000')


Br,

KC

Best Regards,
KC
vikasmahajan
Author

Hi Jonath & Jyothish ,

Thanks for your reply getpossiblecount is giving the no of records available in that field please refer the screen shot

for the same.  Actually we require to change the count no  0 or 1 if  any level is defined in section access.

Thanks

Vikas

Hope this resolve your issue.
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.
jyothish8807
Master II
Master II

Hi Vikas,

In this case you cannot use "getselectedcount" unless you explicitly select a value.

So as per the screenshot you attached, can you let me know what value are you expecting in the variable " vKLTKL" ?

Is it 1 or 1000 ?


I can see multiple levels under the filed.


Br,

KC

Best Regards,
KC