
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Derived fields - $1 meaning & AutoCalendar
Hi Guys,
two questions:
1. Can you pls give me any other real-life, valuable example of using DERIVE & DECLARE instructions than AutoCalendar scenario?
2. I'm testing DERIVED and DECLARE instructions, reading Help but can't really get the idea of this 'referenced field'. Help says:
Use $1 to reference the data field from which the derived fields should be generated.
Example:
Year($1) As Year tagged '$year'
I've tested a typical scenario with AutoCalendar and 4 dates:
DERIVE FIELDS FROM FIELDS [OrderDate], [Date], [RequiredDate], [DeliveryDate] USING [autoCalendar] ;
Is there any reason to change $1 to $2? Is there any other case which works and makes sense?
Scenario 1 - using $1
Scenario 2 - using $2
Many Thanks!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
$1 is simply a placeholder for the field being processed. In your posted example, all fields tagged with '$date' will get processed. If the current field is 'OrderDate', the $1 gets substituted in the script and you have:
Year(OrderDate) As Year tagged '$year'
No, it does not make sense in this example to ever use $2.
-Rob
http://masterssummit.com
http://qlikviewcookbook.com
http://www.easyqlik.com

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
