Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

nareshthavidishetty
Contributor III

Dynamic logic

Hi,

We have an location field which having all locations but we have to capture only few locations which is to be static all the time.

Logic used :=if(location_new<>'016' and location_new<>'025' and location_new<>'099',location_new)

But the new locations got updated frequently so here am not able to capture only the locations which i required.

Locations need to static every time even if the new locations added = 012,034,045,067.

Thanks..

Tags (1)
1 Solution

Accepted Solutions

Re: Dynamic logic

Try this,

=If(Match(location_new,'012','034','045','067'),location_new)

Also, don't forget to enable the option "Suppress When Value Is Null".

View solution in original post

11 Replies
Chanty4u
Esteemed Contributor III

Re: Dynamic logic

try this

=if(location_new<>'016' or  location_new<>'025'  or location_new<>'099','Location_New) as    newlocation

Partner
Partner

Re: Dynamic logic

easiest way would be to define a variable like this:

let vLocNew = '016;025;099';

and test if (match(Location_new, vLocNew)=0

will be tru if Location_new doesnot contain any of the Locations defined in variable

alternatively you may define the new Locations in an Excel list and read this list into a variable

migueldelval
Valued Contributor

Re: Dynamic logic

Hi nareshthavidishetty,

I can´t understand you so well, but Ithink that you can use a variable to make it.

Your variable or variables can represent the values that you want to exclude or show.

Regards

Miguel del Valle

nareshthavidishetty
Contributor III

Re: Dynamic logic

Hi,

I need to show the data for the locations = 012,034,045,067 every time even if the new locations added to the filed.

The logic which we were used(=if(location_new<>'016' and location_new<>'025' and location_new<>'099',location_new)) is not dynamic like when ever an new location added to the field the new location will also show the results.

Result required : My chart should show the data only for(012,034,045,067 ) even if new locations added to the field.

Thanks..
Partner
Partner

Re: Dynamic logic

then this should work

let vLocNew = '012;034;045;067';

if (match(location_new, vLocNew)>0, location_new

only the 4 defined Locations will be displayed, even if 10 locations exists

nareshthavidishetty
Contributor III

Re: Dynamic logic

Hi,

We used the logic as dimension ,it gives empty results =if (match(location_new, vLocNew )>0, location_new)

But when check the variable alone it show the right results.

Thanks..

Partner
Partner

Re: Dynamic logic

does it work when you select only 1 Location?

in a straight table with Dimension Location_new it should work

in a textobject it should work when you select only 1 Location

when no or several locations are selected the if Expression will not work

can you explain your requirements?

nareshthavidishetty
Contributor III

Re: Dynamic logic

Hi,

After the logic used in dimension we were getting no results as below Untitled.png

Chart used: straight table

Logic used: =if (match(location_new, vLocNew )>0, location_new)

Thanks..

Re: Dynamic logic

Try this,

=If(Match(location_new,'012','034','045','067'),location_new)

Also, don't forget to enable the option "Suppress When Value Is Null".

View solution in original post