cancel
Showing results for 
Search instead for 
Did you mean: 

cascading data set automation

Claudia_Coello
Confirmed Champ
Confirmed Champ

is there a way to set up an automated process to add keywords values to the child of a cascading data set? instead of manually going to config and adding the value

1 REPLY 1

Grant_Fitzgeral
Star Contributor
Star Contributor

Good Morning Claudia,

I've been doing something that makes life a lot easier, because cascading data sets can be quite large.

1. Query the database to get all of the data set's records, but double quote delimit/comma separate them. To do this, you're going to want to join the "hsi.multidatasetXXX" table multiple times (XXX being the # of the data set, which you can find when highlighting the data set in config), depending on how many keywords you have, joining the parentnum column to the previous parent level's multikeysetnum and the dslevel field as shown below.

Example:

SELECT '"' + RTRIM(x1.keyvaluechar) 
          + '","' + RTRIM(x2.keyvaluechar)
          + '","' + RTRIM(x3.keyvaluechar) + '"'
FROM hsi.multidatasetXXX x1
          INNER JOIN hsi.multidatasetXXX x2 ON x2.parentnum = x1.multikeysetnum
                  AND x2.dslevel = 1
          INNER JOIN hsi.multidatasetXXX x3 ON x3.parentnum = x2.multikeysetnum
                  AND x3.dslevel = 2
GROUP BY x1.keyvaluechar
          , x2.keyvaluechar
          , x3.keyvaluechar

2. Copy the whole column into a text editor like Notepad++ and save the .txt file.
3. Delete all of the keyword values in Root Data, which will delete all of the children.
4. Go back to the 'Cascading Data Set Configuration' screen and import, selecting the appropriate field delimiter and separator. If you're just adding values, you can skip step 3, but if you're removing or changing values, delete the root data keywords because the import doesn't update values.

Hope this helps!

Thanks,

Grant F