Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
djaykumar
Contributor
Contributor

Set Analysis selections

Hi All,

I am in deep struggling with set Analysis .

I have four input fields 

GroupName

Region

Department

SINO

If I select a datafield in GroupName , Region,Department and SINO in my Pivot table only that selected line item should be calculated and rest of the values will remains same. I have achieved the above requirement. But If I ignore any of the  above fields from selection its not working. for example If I select one data element from Group name, Region and ignore Department and SINO my code is not working. My code is below

=sum({1}if(wildmatch(vGroupName,'*~' & GroupName & '~*')> 0 and wildmatch(vRegionName,'*~' & RegionName & '~*') > 0 and wildmatch(vDepartment,'*~' & Department & '~*') > 0 and wildmatch(SINO ,'*~' & SINO  & '~*') > 0,sales*(1.0+vSales/100.0), Sales))

in the above code 

vGroupName  =If(GetSelectedCount(GroupName) > 0, Concat(DISTINCT '~' & GroupName & '~', ','))

vRegionName = If(GetSelectedCount(RegionName ) > 0, Concat(DISTINCT '~' & RegionName & '~', ','))

.

.

Please help me in this .

 

 

 

1 Solution

Accepted Solutions
sunny_talwar

May be use GetPossibleCount() vs. using GetSelectedCount()

=If(GetPossibleCount(SINO) > 0, Concat(DISTINCT '~' & SINO & '~', ','))

=If(GetPossibleCount(Department) > 0, Concat(DISTINCT '~' & Department & '~', ','))

=If(GetPossibleCount(GroupName) > 0, Concat(DISTINCT '~' & GroupName & '~', ','))

=If(GetPossibleCount(Region) > 0, Concat(DISTINCT '~' & Region & '~', ','))

image.png

View solution in original post

5 Replies
sunny_talwar


@djaykumar wrote:

If I select one data element from Group name, Region and ignore Department and SINO my code is not working. My code is below 


What exactly do you mean when you ignore ....? I am not sure I understand the issue. Do you want to may be explain giving an example?

djaykumar
Contributor
Contributor
Author

Hi Sunny,

Thank you for quick response.

Please find attachment .

Regards,

Jay

 

djaykumar
Contributor
Contributor
Author

sorry attaching qlikview

sunny_talwar

May be use GetPossibleCount() vs. using GetSelectedCount()

=If(GetPossibleCount(SINO) > 0, Concat(DISTINCT '~' & SINO & '~', ','))

=If(GetPossibleCount(Department) > 0, Concat(DISTINCT '~' & Department & '~', ','))

=If(GetPossibleCount(GroupName) > 0, Concat(DISTINCT '~' & GroupName & '~', ','))

=If(GetPossibleCount(Region) > 0, Concat(DISTINCT '~' & Region & '~', ','))

image.png

djaykumar
Contributor
Contributor
Author

Thank you Sunny,

Working perfectly

Regards,

Jay