Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

aveeeeeee7en
Valued Contributor III

GetPossibleCount() Example

Hi Community

Can anybody gave me the Example of GetPossibleCount() with Attachment.

Regards

Aviral Nag

1 Solution

Accepted Solutions
MVP
MVP

Re: Re: Re: GetPossibleCount() Example

Use show condition expression (layout tab) like:

SubStringCount(Concat(Level,';'),'1') -- for Level 1

SubStringCount(Concat(Level,';'),'2') -- for Level 2

...

PFA

6 Replies
jagannalla
Valued Contributor III

Re: GetPossibleCount() Example

Hi,

if you have sales data for different countries.

For eg:

CountrySalesData
India200
India400
US100
US50
US20

Now when you select India from country and in text object if you place GetPossibleCount(SalesData) it returns 2. B'coz we have 2 possible values for India. If you clear it will give 5

Thanks,

Jagan

aveeeeeee7en
Valued Contributor III

Re: Re: GetPossibleCount() Example

Can you help me in the Attached Scenario.

MVP
MVP

Re: Re: Re: GetPossibleCount() Example

Use show condition expression (layout tab) like:

SubStringCount(Concat(Level,';'),'1') -- for Level 1

SubStringCount(Concat(Level,';'),'2') -- for Level 2

...

PFA

jagannalla
Valued Contributor III

Re: Re: Re: GetPossibleCount() Example

Hi,

You can't use expression in getpossiblecount, we can use only fieldnames. Please try to convert all your expressions into script level. As below,

Test:

LOAD emp_name AS EmpID,

     emp_name AS Name,

     superior AS [Reporting To],

     emp_sub_department AS Department,

     emp_code,

     emp_location

  

FROM

(ooxml, embedded labels, table is Sheet1);

Hierarchy:

Hierarchy (EmpID,[Reporting To],Name,Manager,Name,EmpTree,'/',Level)

LOAD *

RESIDENT Test;

DROP TABLE Test;

LOAD EmpID,

if(Level=1,Name&chr(13)&emp_location&chr(13)&Department) as Level1,

if(Level=2,Name&chr(13)&emp_location&chr(13)&Department) as Level2,

if(Level=3,Name&chr(13)&emp_location&chr(13)&Department) as Level3,

if(Level=4,Name&chr(13)&emp_location&chr(13)&Department) as Level4

Resident Hierarchy;

- Now add Level1 into listbox and in listbox properties -> Layout -> Show (enable conditional) and paste this exp =if(GetPossibleCount(Level1)>0,True(),False())

- Repeat this step for other listboxes by changing the expression. i.e. instead of Level1 use Level2, Level3 and Level4

Hope it helps you

Cheers!!!

Jagan

aveeeeeee7en
Valued Contributor III

Re: Re: GetPossibleCount() Example

Hey Tresesco Thanks a Ton.

This was something Awesome.............. Loved it..

Thanks You very Much. You made my day......... :-)

Regards

Aviral Nag

aveeeeeee7en
Valued Contributor III

Re: Re: GetPossibleCount() Example

Thanks Jagan

I love your Approach.

Thank You very Much.

Regards

Aviral Nag