Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Posting on Qlik Community is temporarily paused for some users. Thank you for patience and we'll update you soon!
cancel
Showing results for 
Search instead for 
Did you mean: 
shane_spencer
Specialist
Specialist

Using a different variable in load script depending of field contents

I'm loading data and using Firstworkdate to work out working days.

I've got a number of variables for each Country with list of non working days.

i.e.

$(vHoliday_FR)

$(vHoliday_GB)

$(vHoliday_US)

etc.

I've got a field in my data called COUNTRY with a two letter country code in it for each row. i.e. FR, GB or US etc

What I want to do is use the COUNTRY field to select which variable I use.  How do I do that?

So instead of :

DATE( Firstworkdate(Num(ACTUAL_DEADLINE_PAYMENT_DATE_calc),2,$(vHoliday_SG) ))

I would have 

DATE( Firstworkdate(Num(ACTUAL_DEADLINE_PAYMENT_DATE_calc),2,$(vHoliday_??) ))

where ?? is the COUNTRY field. Is this possible?

 

 

Labels (1)
1 Solution

Accepted Solutions
marcus_sommer
MVP
MVP

You could try it with something like this:

Firstworkdate(ACTUAL_DEADLINE_PAYMENT_DATE_calc,2,evaluate('vHoliday_' & Country))

- Marcus

View solution in original post

1 Reply
marcus_sommer
MVP
MVP

You could try it with something like this:

Firstworkdate(ACTUAL_DEADLINE_PAYMENT_DATE_calc,2,evaluate('vHoliday_' & Country))

- Marcus