Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have a rather inconvenient input structure that I need to process in my load script. The third input column holds data that I need to allocate to either one or another table column depending on the value present.
Input structure:
| Level1 | Level2 | Level3 OR Label |
| A | B | C |
| D | E | S_123 |
Desired Outcome:
| Level1 | Level2 | Level3 | Label |
| A | B | C | |
| D | E | S_123 |
Is there any way to dynamically select the target column? I've tried something similar to
[@3] as If(LEFT([@3],1)='S', 'Level3', 'Label') --- However, this raises an error.
I'm aware I could simply write an if-clause for both columns to be filled or to be left blank. The problem is the real data is more complex and more nested than shown above. As such the data for an output column could come from a number of different columns. A dynamic column allocation would make my life a lot easier.
Any ideas on how to approach this? Thanks!
Script Syntax does not allow fieldname to be specified conditionally. I can think of two approaches:
1. Process your input file in multiple passes, processing each output field in a different pass.
2. Generate a temporary three field Generic structure and then use Generic Load to put the data in the proper columns. See https://qlikviewcookbook.com/2010/05/use-cases-for-generic-load/
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Script Syntax does not allow fieldname to be specified conditionally. I can think of two approaches:
1. Process your input file in multiple passes, processing each output field in a different pass.
2. Generate a temporary three field Generic structure and then use Generic Load to put the data in the proper columns. See https://qlikviewcookbook.com/2010/05/use-cases-for-generic-load/
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com
Ok, I'll have to give that a go. Thanks for the quick reply!