Skip to main content
Announcements
July 15, NEW Customer Portal: Initial launch will improve how you submit Support Cases. IMPORTANT DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
simonaubert
Partner - Specialist II
Partner - Specialist II

Tag Value for Security Rules not available through QRS?

Hello all,

Pretty weird but I don't manage to retrieve Tag value from security rules

Script  :

LIB CONNECT TO 'REST_Custom_Monitor_SystemRule';

RestConnectorMasterTable:
SQL SELECT 
	"id",
	"createdDate",
	"modifiedDate",
	"modifiedByUserName",
	"category",
	"subcategory",
	"type",
	"name",
	"rule",
	"resourceFilter",
	"actions",
	"comment",
	"disabled",
	"ruleContext",
	"seedId",
	"version",
	"privileges",
	"schemaPath",
	"__KEY_root",
	(SELECT 
		"@Value",
		"__FK_tags"
	FROM "tags" FK "__FK_tags" ArrayValueAlias "@Value")
FROM JSON (wrap on) "root" PK "__KEY_root";

[tags]:
LOAD	[@Value],
[__FK_tags] AS [__KEY_root]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__FK_tags]);


[Qlik System Rule]:
LOAD	[id] as [Qlik System Rule Id],
	[createdDate] as [Qlik System Creation Date],
	[modifiedDate] as [Qlik System Rule Modification Date],
	[modifiedByUserName] as [Qlik System Rule Modified by UserName],
	[category] as [Qlik System Rule Category],
	[subcategory] as [Qlik System Subcategory],
	[type] as [Qlik System Rule Type],
	[name] as [Qlik System Rule Name],
	[rule] as [Qlik System Rule Rule],
	[resourceFilter] as [Qlik System Rule Resource Filter],
	[actions] as [Qlik System Rule Actions],
	[comment] as [Qlik System Rule Comment],
	[disabled] as [Qlik System Rule Disabled],
	[ruleContext] as [Qlik System Rule RuleContext],
	[seedId] as [Qlik System Rule Seed Id],
	[version] as [Qlik System Rule Version],
	[privileges] as [Qlik System Rule Privileges],
	[schemaPath] as [Qlik System Rule Schema Path]
RESIDENT RestConnectorMasterTable
WHERE NOT IsNull([__KEY_root]);


DROP TABLE RestConnectorMasterTable;

exit script;

 

Log

15:55:08
Message effacé.
15:55:40
---
Chargement de données démarré
---
Connecté
RestConnectorMasterTable << RestConnectorMasterTable
Lignes extraites : 158
tags << RestConnectorMasterTable
Lignes extraites : 3
Qlik System Rule << RestConnectorMasterTable
Lignes extraites : 155
---
Application enregistrée
Opération terminée correctement
0 erreur(s) forcée(s)
0 clé(s) synthétique(s)

 

As you can see, Qlik finds 3 rows for tags (which is true )but when I visualize it, the value are null ???

 

simonaubert_1-1647702427191.png

I use Qlik Sense Server May 2021 Patch 4.

Best regards,

 

Simon

Bi Consultant (Dataviz & Dataprep) @ Business & Decision
Labels (2)
1 Solution

Accepted Solutions
simonaubert
Partner - Specialist II
Partner - Specialist II
Author

Hello all, I found the issue :

The code given by Qlik is not correct because we can't parse the Array. it should be :

RestConnectorMasterTable:
SQL SELECT 
	"id",
	"createdDate",
	"modifiedDate",
	"modifiedByUserName",
	"category",
	"subcategory",
	"type",
	"name",
	"rule",
	"resourceFilter",
	"actions",
	"comment",
	"disabled",
	"ruleContext",
	"seedId",
	"version",
	"privileges",
	"schemaPath",
	"__KEY_root",
//Code given by Qlik : KO
// 	(SELECT 
// 		"@Value" AS "tag_tag_@Value",
// 		"__FK_tags"
// 	FROM "tags" FK "__FK_tags" ArrayValueAlias "tag_tag_@Value")
//Code I corrected : OK
	(SELECT 
		"id" AS "tag_tag_id",
		"name" AS "tag_tag_name",
		"privileges" AS "tag_tag_privileges",
		"__FK_tags"
	FROM "tags" FK "__FK_tags")
FROM JSON (wrap on) "root" PK "__KEY_root";

 

Same for tags on user, Application, etc...

 

Best regards,

 

Simon

Bi Consultant (Dataviz & Dataprep) @ Business & Decision

View solution in original post

1 Reply
simonaubert
Partner - Specialist II
Partner - Specialist II
Author

Hello all, I found the issue :

The code given by Qlik is not correct because we can't parse the Array. it should be :

RestConnectorMasterTable:
SQL SELECT 
	"id",
	"createdDate",
	"modifiedDate",
	"modifiedByUserName",
	"category",
	"subcategory",
	"type",
	"name",
	"rule",
	"resourceFilter",
	"actions",
	"comment",
	"disabled",
	"ruleContext",
	"seedId",
	"version",
	"privileges",
	"schemaPath",
	"__KEY_root",
//Code given by Qlik : KO
// 	(SELECT 
// 		"@Value" AS "tag_tag_@Value",
// 		"__FK_tags"
// 	FROM "tags" FK "__FK_tags" ArrayValueAlias "tag_tag_@Value")
//Code I corrected : OK
	(SELECT 
		"id" AS "tag_tag_id",
		"name" AS "tag_tag_name",
		"privileges" AS "tag_tag_privileges",
		"__FK_tags"
	FROM "tags" FK "__FK_tags")
FROM JSON (wrap on) "root" PK "__KEY_root";

 

Same for tags on user, Application, etc...

 

Best regards,

 

Simon

Bi Consultant (Dataviz & Dataprep) @ Business & Decision