Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
briwilli
Contributor III
Contributor III

Is it possible to re-code variables in a mashup

The project I support has the requirement to provide users with the capability to re-code dimensions. For instance, one dimension in our Qlik Sense app is Field of Study with values like Agriculture, Biology, Chemistry, Computer Sciences, Education, Engineering, and Mathematics. A user may want re-code this dimension so that the value are Education, Engineering, and Other (in this case, Other would consist of a Agriculture, Biology, Chemistry, Computer Sciences, and Mathematics).  The data rendered in the visualization could then be filtered on these 3 values.  Similarly, another user may want to re-code this dimension as Biology, Chemistry, Computer Sciences, and Other (in this case Other would consist of Agriculture, Education, Engineering, and Mathematics). These re-code definitions would be dynamic and not saved anywhere.

Users access our Qlik Sense apps through a web mashup, so users would need to be able perform the re-coding through the web app using custom code that utilize the Qlik APIs.  Does anyone know if this is even possible? I haven't seen anything that references this type of capability.

2 Replies
rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

It's quite possible with a couple of approaches.  If you are creating the chart in QS, use a Calculated Dimension like:

=aggr(if(Match(Subject, $(vOtherList)), 'Other', Subject), Subject)

Then your mashup can set the contents of vOtherList using the Variable API.  Set it to a comma separated quoted list like:

'Agriculture', 'Biology', 'Chemistry', 'Computer Sciences'

See attached example.

An alternative method might be to use the ApplyPatches() method against the chart hypercube to update the DImension directly.

-Rob

http://masterssummit.com

http://qlikviewcookbook.com

http://www.easyqlik.com

briwilli
Contributor III
Contributor III
Author

‌Thanks Rob, i’ll Try out your suggestions