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: 
pernillet
Contributor II
Contributor II

How to get past NOT, in the GetFieldSelections

As a part of my expession I have used

if( SubStringCount(GetFieldSelections(Month),'Jan')....

My problem is, when I chose more than half of my months instead of returning jan, feb, mar ...(the selected) then the sting return NOT(Aug, sep,)

So if I aske if the substringcount includes January, and I have selcted everything else but January, then the expression will still tel me, that January is a selcted value.

Is there an easy way to correct this?

Best

Pernille 

1 Solution

Accepted Solutions
jonathandienst
Partner - Champion III
Partner - Champion III

Pernille

You could also try something like this:

If(Left(GetFieldSelections(Month), 3) = 'NOT',

          If(SubStringCount(GetFieldSelections(Month),'Jan') = 0,

                    ... Does not contain Jan in NOT form ...

          )

          If(SubStringCount(GetFieldSelections(Month),'Jan') = 0,

                    ... Contains Jan in normal form ...

          )

)

Hope that helps

Jonathan

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

View solution in original post

6 Replies
Gysbert_Wassenaar

Have you tried increasing the number of items that GetFieldSelections returns?

getfieldselections ( Month, ',' , 12 )


talk is cheap, supply exceeds demand
jonathandienst
Partner - Champion III
Partner - Champion III

Pernille

You could also try something like this:

If(Left(GetFieldSelections(Month), 3) = 'NOT',

          If(SubStringCount(GetFieldSelections(Month),'Jan') = 0,

                    ... Does not contain Jan in NOT form ...

          )

          If(SubStringCount(GetFieldSelections(Month),'Jan') = 0,

                    ... Contains Jan in normal form ...

          )

)

Hope that helps

Jonathan

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

It dit not do any changes

pernillet
Contributor II
Contributor II
Author

A lot of if's, but usefull

Gysbert_Wassenaar

Weird, works fine for me in QV10.


talk is cheap, supply exceeds demand
pernillet
Contributor II
Contributor II
Author

I'm also i QV10