Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
SK28
Creator
Creator

getfield selections & Get field count

Hi I have drill down Manager data in a table.

 

it has 4 levels

Manager Target Completed
A 121 Y
B 120 N
C 111 Y
D 130 5
Total 482  

In the above example the manager column is Drill Column.

Manager1, Manager2, Manager3, Manager4, If clicked on Manager1, Manager2 will display and their Subodinate

 

I have Enabled total

My requirements here is,

In the place of Total, The Default should be shown as Raj

where Manage1 get selected, near the total, it should reflect Manger1 name

For example if I select A(Manager1) then it show as Manager A name in the total.

and if I selected Manager2 name it should as Manager2 name as total.

Similarly for Manager 3 & 4

 

In total column, I have used 

If(getselectedcount(manager1)>0, getfieldselections(manager1),

If(getselectedcount(manager2)>0, getfieldselections(manager2),

If(getselectedcount(manager3)>0, getfieldselections(manager3),

If(getselectedcount(manager4)>0, getfieldselections(manager4),'Raj')))

 

It's working fine for Manager 1 and Manager 2,

if I drill down to Manager 3, It's not showing Manager 3 name.

 

Can you please help me on this

 

 

1 Solution

Accepted Solutions
ajaykakkar93
Specialist III
Specialist III

hi,

Expression should be 

If(getselectedcount(manager1)>0 and (getselectedcount(manager2)=0 and getselectedcount(manager3)=0 and getselectedcount(manager4)=0 ), getfieldselections(manager1),

........ 

above will give you manager one only same will go for manager 2 

If(getselectedcount(manager1)>0 and getselectedcount(manager2)>0 and (getselectedcount(manager3)=0 and getselectedcount(manager4)=0 ), getfieldselections(manager2),
.....



Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

View solution in original post

2 Replies
ajaykakkar93
Specialist III
Specialist III

hi,

Expression should be 

If(getselectedcount(manager1)>0 and (getselectedcount(manager2)=0 and getselectedcount(manager3)=0 and getselectedcount(manager4)=0 ), getfieldselections(manager1),

........ 

above will give you manager one only same will go for manager 2 

If(getselectedcount(manager1)>0 and getselectedcount(manager2)>0 and (getselectedcount(manager3)=0 and getselectedcount(manager4)=0 ), getfieldselections(manager2),
.....



Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

vinieme12
Champion III
Champion III

Simply reverse the order from lowest to highest

 

=If(getselectedcount(manager4)>0, getfieldselections(manager4),

If(getselectedcount(manager3)>0, getfieldselections(manager3),

If(getselectedcount(manager2)>0, getfieldselections(manager2),

If(getselectedcount(manager1)>0, getfieldselections(manager1),'Raj')))

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.