Forum Discussion
create parameter from concatenation
- 3 years ago
It seems that it's not possible to create parameters from other parameters (unless you query parameters, which is not applicable in my scenario). The solution is...
1) create the following 3 parameters:
parameter A = 'some super long path'
parameter B = \Excel_file1.xlsx'
parameter C = '\Excel_file2.xlsx'
2) and then concatenate the parameters at the query level, e.g.:
let
FullFilePath = #"parameter A" & #"parameter B",
Source = Excel.Workbook(File.Contents(FullFilePath ), null, true),...
Those links don't apply to my specific situation (at least, I don't think). My situation is more generic. To be more clear, let's say that I have the following two sources:
1) 'some super long path'\Excel_file1.xlsx
2) 'some super long path'\Excel_file2.xlsx
Even though I won't be changing the sources, it's still a good idea to parameterize them. At a minimum, I would create two parameters (one for each source). But, since 'some super long path' is the same path in both sources / parameters, I was hoping to make that some sort of constant (parameter?) that is available to both sources. I was hoping that the solution would be something like:
parameter A = 'some super long path'
parameter B = parameter A + '\Excel_file1.xlsx'
parameter C = parameter A + '\Excel_file2.xlsx'
But, that doesn't seem to be permissible. As far as I know, the "list" solution (create parameter for 'some super long path', create list holding the Excel workbook names, create parameter that queries the list) won't work for me, as it requires a current value (a value that must be used by both sources), which defeats the purpose.
It seems that it's not possible to create parameters from other parameters (unless you query parameters, which is not applicable in my scenario). The solution is...
1) create the following 3 parameters:
parameter A = 'some super long path'
parameter B = \Excel_file1.xlsx'
parameter C = '\Excel_file2.xlsx'
2) and then concatenate the parameters at the query level, e.g.:
let
FullFilePath = #"parameter A" & #"parameter B",
Source = Excel.Workbook(File.Contents(FullFilePath ), null, true),
...