Qlik Community

Ask a Question

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Populate an Array in an Expression

Hello fellow QlikDevs!

I created a report built (partially) upon a Quickbase table.  For those of you who've never worked with Quickbase, it's the ultimate User Defined Cloud Hosted database that laughs in the face of Boyce-Codd.  I had to do a bit of wrangling to create a normalized data model.  So, now I have a table with a record linked to another table that contains "Workgroups" linked by RecordID.  There are between 1 and 5 Workgroups for each record, ranking has meaning so the final output looks like this:

2017-01-12_12-03-44.jpg

Where each unique row contains the key field "Record ID#", 1>=Workgroup<=5,  Order (defining rank within the record).  The primary "DefConRecord" table contains a field titled "IDP".  For each IDP, there are 1-5 Workgroups.  My task is to match each Workgroup to it's associated employees in another dataset.

I need a way to link each unique Workgroup (a subset of the IDP) to the employees associated with it.  I believe an Array, populated with 1-5 Workgroups associated with the unique IDP would give me the tools necessary to iterate through the Employee dataset and find matches.

So, at this point, my data looks like this:

2.jpg

The other half of the dataset is the Employee "Activation" records.  A recordset containing the date/time an employee was "Activated" for a given Workgroup.  The idea is to track how quickly an employee is activated within a window of time around the DefConRecord Create DateTime.  This need to be determined dynamically, as the Record ID# is selected.

My goal is to build either a Line Chart or Scatter chart with the DefConRecord Create Date timestamp as one datapoint and all employees activation timestamps as contrasting datapoint across a window of time.

If I could build a dynamic array out of the Workgroups associated by the IDP, I could match each Workgroup and time window against all Activation timestamps for the matching Workgroups.

I created a variable titled vWorkgroups in the Variable Overview dialog, now I'm trying to work out the best method of populating it with the Workgroups associated with the IDP identified in the DefConRecord within an Expression.  Then I can take that variable in a Chart Expression and iterate over Workgroup Activations where WorkgroupArray=ActivationWorkgroup and within Time Window.

Rather that listing my failed attempt's, I'd like to leave the slate clean for your ideas.

Thanks for reading and much gratitude for any suggestions.

2 Replies
Not applicable

Have a look at the following article, it might help:

Understanding VBScript: Arrays | Scripting content from Windows IT Pro

Good Luck,

Pravesh

Not applicable

Thank you for your response Pravesh.  I'm familiar with VBScript syntax and data structures, what I don't know, google is pretty good at answering.  What I was hoping for is some guidelines, or Best Practices in linking macros to events. 

I figured it out though, with continued searching through forums and such I found parts and pieces until I had a complete answer.  It turns out I didn't need a WScript/JScript, the qlikview function Concat() did the job well enough.

I also found this article: Trigger in List Box ! | Qlik Community that explains how to attach a Field Event Trigger to a listbox.

Action.png

This doesn't solve the entire problem but it's a good start!

Thanks again, I'll be closing this out now.