Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Modernize Your QlikView Deployment webinar, Nov. 3rd. REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Creator
Creator

Dynamically name a field in set analysis

Hello,

I'm trying to do something that is not working, although I'm not too sure it is even possible in the first place.

What I'm attempting to do is dynamically create a field in a set analysis, so that it will be a different field depending on the selected scenario. Example:

Let's assume I have a field named OrderDate with the values Request and Confirmed.
Then, I have another two fields named OrderDateRequest and OrderDateConfirmed.


In the set analysis I would like to do the following:

sum(<{OrderDate$(OrderDate)={'20/02/2018'}>}#Volume)

Is it possible, to dynamically name a field like this? So that when I select Request or Confirmed on OrderDate it be selecting a values from different fields.

Thank you.

Best Regards,

André Braga

1 Solution

Accepted Solutions
Highlighted
Creator
Creator

Hello Olivier,

I did manage to solve it by creating 2 variables for this - $(OrderDate) which has as value the OrderDate field, and the second variable $(OrderBacklogDate) with the value ='OrderDate'&$(OrderDate).


By using $(OrderBacklogDate)={'20/02/2018'}, I have now the desirable outcome.

Your example didn't fully reflect my intent, partly because the value selections of the OrderDate field, do not reflect the name of the fields I wanted to portray. Nonetheless it really helped me expand my thought horizon and create new ideas on how to tackle the issue. Thank you!!

Best Regards,

André Braga

View solution in original post

2 Replies
Highlighted
Specialist II
Specialist II

Hi,

you could add a variable like :

vField = if(GetFieldSelections(OrderDate)='Request','OrderDateRequest','OrderDateConfirmed')

then sum(   {< $(v) = {xxxxxxxxx} volume)

regards

Highlighted
Creator
Creator

Hello Olivier,

I did manage to solve it by creating 2 variables for this - $(OrderDate) which has as value the OrderDate field, and the second variable $(OrderBacklogDate) with the value ='OrderDate'&$(OrderDate).


By using $(OrderBacklogDate)={'20/02/2018'}, I have now the desirable outcome.

Your example didn't fully reflect my intent, partly because the value selections of the OrderDate field, do not reflect the name of the fields I wanted to portray. Nonetheless it really helped me expand my thought horizon and create new ideas on how to tackle the issue. Thank you!!

Best Regards,

André Braga

View solution in original post