Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

set analysis(urgent)

can i use 'getfieldselection' in the modifier?

10 Replies
Not applicable
Author

I think you can use any function in the modifier, so thisone as well. What are you trying to achieve, or what is the problem you run into?

SunilChauhan
Champion II
Champion II

see attached file

Sunil Chauhan
Not applicable
Author

i am trying this function:

 

sum

({$<[Time Bucket Name] = GetFieldSelections([Time Bucket Name]), [Time Bucket Type] = {'CURRENT'}, [TA Sort Order] =>}NUM_ACTV_PTNT) - sum({$<[Time Bucket Name] = GetFieldSelections([Time Bucket Name]), [Time Bucket Type] = {'PREVIOUS'}, [TA Sort Order] =>}NUM_ACTV_PTNT))

and as u can see, there is some error and the expression editor is also giving the error: Error in set modifier element function.

Please help

Not applicable
Author

I think it should be like this

sum

({

$<

[Time Bucket Name] = {$(=GetFieldSelections([Time Bucket Name]))},

[Time Bucket Type] = {'CURRENT'},

[TA Sort Order] =>}NUM_ACTV_PTNT

)

-

sum({$<[Time Bucket Name] = {$(=GetFieldSelections([Time Bucket Name]))},

[Time Bucket Type] = {'PREVIOUS'},

[TA Sort Order] =>}

NUM_ACTV_PTNT))

Please also compare your syntax with Sunil Chauhan's example. THe getFieldSelections() function cannot be used like you use it, but must be surrounded by {} and by $() (dollar sign expansion)

SunilChauhan
Champion II
Champion II

sum

({$<[Time Bucket Name] = {$(=GetFieldSelections([Time Bucket Name]))}, [Time Bucket Type] = {'CURRENT'}, [TA Sort Order] =>}NUM_ACTV_PTNT) - sum({$<[Time Bucket Name] = GetFieldSelections([Time Bucket Name]), [Time Bucket Type] = {'PREVIOUS'}, [TA Sort Order] =>}NUM_ACTV_PTNT))

use  this code

hope this helps

Sunil Chauhan
Not applicable
Author

I updated Sunil Chauhan's expression a bit, to support cases in which the field EMP has spaces in the field. See attached example.

SunilChauhan
Champion II
Champion II

its working i thing 

what is your problem now

Sunil Chauhan
Not applicable
Author

Thanks for the reply guys but it isn't working for me.

Not applicable
Author

Can you give some more details?

Ideally a sample QVW, but otherwise a description of what's going wrong?