Knowledge: SQL to Lookup Secondary Taxonomy Level
Back
    Title*SQL to Lookup Secondary Taxonomy Level
    ManualReporting
    Created09/04/2019
    Detail

    Input of this data action must be named InValue and come from root taxonomy setting.

    if ISNULL(@InValue,'') = ''
    BEGIN
    SET @InValue = 'All'
    END
    DECLARE @TaxonomyID as int = 1;
    DECLARE @ParentEntryID as nvarchar(max) = '';
    DECLARE @Pos as int;
    SELECT @pos = CHARINDEX('|', @InValue) ;
    SELECT @ParentEntryID = SUBSTRING(@InValue, @pos+1, len(@InValue)-1);
    IF ISNUMERIC(@ParentEntryID) = 0
    BEGIN
    SET @ParentEntryID = -1
    END
    Select ' - All - ' as Name, 'All' as Value UNION
    Select Name, Value + '|' + RTRIM(LTRIM(CAST(ID as nvarchar(max)))) as Value FROM TaxonomyEntries WHERE ISNULL(ParentEntryID,0) = @ParentEntryID
    and TaxonomyID=@TaxonomyID
    Order By Name

    ManualManual Level TwoManual Level Three
    AdministrationData ActionsSQL
    Privacy Policy
    Cookies help us to improve your user experience. By using this site you consent to cookies being stored on your device. Read more...
    View or hide all system messages