handling Unknown variable (check if column exists)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi!
Is it solution to check if a column exists or not and go ahead with the calculation only if the column exists?
By my example I use the Cross Tab Tool and my output columns are variable.
And so it is possible that a column is not always in the output but if exists in the output than make a calculation.
At the moment I get the error message from the Formula Tool.
Formula (..) Unknown variable "<my varialble>"...
Mathias
Solved! Go to Solution.
- Labels:
- Error Message
- Parse
- Preparation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Take the data into a filter for the True data use a formula where you expect the field. For the false data use a formula that doesn't expect it.
Union the true and false (you'll only have all true or all false)
That's my idea.
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am attaching the updated flow here, but have a question for you. Is the file layout consistent except for 'FOO'? There is an easy approach for that. If the field list looks like:
{Foo, Bah, Blubber} or {Bah, Blubber}, then you can create a sample row of data using a text input (like you did already) and UNION it together with your input tool (set your text file as the 1st file in (specific output order configuration). You can then SAMPLE and SKIP the first record. If Foo exists, it will have it's value and if Foo is absent, it will become NULL.
You can then handle the formula based upon IIF(isnull([Foo],0,[Foo})
Just a thought.
You can PM me and we can chat on skype or webex.
Thanks,
Mark
Chaos reigns within. Repent, reflect and restart. Order shall return.
Please Subscribe to my youTube channel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi,
I have tested you solution it works great.
I have expanded your solution without Foo column.
The expansion closer than how I will use it in the future!
Mabe your question was responded already.
It would be nice if you can have a look on it!?!
I have a question still to you:
What is the advantage to use the Detour Tools? The result is always the same.
Mathias
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
