Solved

How can i still get attribute values if one of two user parameters is left empty?

  • 1 December 2017
  • 9 replies
  • 5 views

I created 3 published parameters but if one is left blank the attribute has no values.

 

If just one or two of the three parameters is filled in the blank one has to display its standard values.

 

How can I realize this?

Update*:

Before running the model the user need to fill in the parameters. Users can choose to fill in zipcodes or municipalities. If one of these parameters is left blank, the table in the dataviewer of the blank parameter has no data. If no parameters are given it won't show any data and I want all the data to be displayed when no parameters are given.

The model is really simple since I created my reader with a more complicated model.

 

I just want to give the users the possibility to get the access to the data based on location.

 

I hope that my question is more clear now.

icon

Best answer by takashi 3 December 2017, 09:32

View original

9 replies

Badge +22
How are you creating the attribute?

 

 

Userlevel 2
Badge +16

Could you explain a little more? Use an example.

My first thought is NullAttributeMapper.

Have a look if that solves the issue.

Userlevel 4
Badge +13

Can you provide the workspace or a more detailed description? You might want to consider setting a default value for the published parameters if you don't want to deal with blank or empty inputs.

Badge +3

conditional attribute creator.

It seems you are creating an attribute using a expression(?)

Empty or missing attribute would be missing operands (check navigator)

Can't check those in a expression as they are not present..

Null/missing value replacer is not always viable, it might yield incorrect result or a error in case of for instance a division.

Userlevel 3
Badge +17

possibly I don't exactly understand your requirement, but if you need to set a parameter value according to the given value(s) of other published user parameter(s), scripted parameter could be a choice.

Userlevel 3
Badge +17
Sorry, I'm still unclear what your requirement is. Can you fill the blank cells to complete this table?

 

zipcode

 

municipalityWhat should happen?has a valuehas a valuehas a value<not set><not set>has a value<not set><not set>

 

 

 

possibly I don't exactly understand your requirement, but if you need to set a parameter value according to the given value(s) of other published user parameter(s), scripted parameter could be a choice.

Thanks for all the suggestions. It appeared to be a merging problem earlier in the model.

 

It is working fine now.

 

 

Userlevel 3
Badge +17
Is it correct?

 

  • Only if the two parameters "zipcode" and "municipality" both were given by the user, the values of the two attributes "zipcode" and "municipality" read from the source dataset should be replaced with the parameter values.
  • If one or both parameter were not given, the two attributes should be preserved as is.
Userlevel 3
Badge +17
If I understood your requirement correctly, this workflow could help you.

 

 

Reply