Hi all,
I'm trying to populate a dropdown with dynamic values according the value coming from another dropdown, like unit measure for example:
if the dropdown A contains Fruits the B will contain (1000 gr, 100 hg, 1 kG ) instead if the A cointains Liquid B will cointains (1000 ml. 100 cl. )
where 1000/100/1 will be Field For Value
and gr hg and KG will be field for Label.
I'm trying something like this :
| makeresults
| eval type="fruits"
| eval unit=case(type=="fruits","1000 gr, 100 hg, 1 kg", type=="liquid","1000 ml, 100 cl", 1=1, "no vlaue")
| rex field=unit "(?<A>.*)\,(?<B>.*)"
| fields A B
But I'm not be able to parameterize the two or three values in the fields to make the split..
Thanks
Does this work for you?
| makeresults
| eval type="fruits"
| eval unit=case(type=="fruits","1000#gr, 100#hg, 1#kg", type=="liquid","1000#ml, 100#cl", 1=1, "no vlaue")|makemv unit delim=","|mvexpand unit
| rex field=unit "(?<A>.*)#(?<B>.*)"
| fields A B
Does this work for you?
| makeresults
| eval type="fruits"
| eval unit=case(type=="fruits","1000#gr, 100#hg, 1#kg", type=="liquid","1000#ml, 100#cl", 1=1, "no vlaue")|makemv unit delim=","|mvexpand unit
| rex field=unit "(?<A>.*)#(?<B>.*)"
| fields A B
Thanks a lot