Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
mwallman
Creator III
Creator III

Complicated user request: How to deal with expressions that change over time in QlikView?

Hi all,

I have a rather complicated user request from a user.

I have some data where there are over 300 metrics. These metrics will change over time. So for example you might calculate sales measure differently from Jan 2009 to Dec 2009 compared to Jan 2010 to Dec 2010.

The table might look like:

MetricName
Expression
From
ToJan2015
Feb2015
Mar2015
Jan2016
Feb2016
Mar2016
SalesSum({<Rate={34}>}LineSalesAmount)Jan2016Feb20160.20.20.4
SalesSum({<Rate={34, 36}>}LineSalesAmount)Mar216Jul20160.40.70.1
OrdersSum(OrderRecordCounter)Jan2015Aug20151.51.31.4
OrdersSum({<Multiplier={2}>}OrderRecordCounter)Sept2015Dec20151.80.41.1

In the above, you can see the expression changes over time as well as some sort of rate associated is used differently.

How can I user use a certain expression for data at a certain time period?

I imagine this is a vague question which I am fully not sure how to explore so any help would be great!

1 Reply
jonathandienst
Partner - Champion III
Partner - Champion III

This will require a combination of:

  • Add a sequence number to the instances of a particular metric (eg Sales.Sequence, Orders.Sequence)
  • Interval matching to relate the metric sequence number with a month range to the individual months (and storing the expression sequence number for the month)
  • Construction of a Pick() compound expression by concatenating the expressions and sequence numbers into a variable to get something like:


     vExp.Sales = Pick(Sales.SequenceNo, <... expression 1 for sales ...>, <... expression 2 for sales ...>, ....);

     vExp.Orders= Pick(Order.SequenceNo, <... expression 1 for orders ...>, <... expression 2 for orders ...>, ....);

    (you would build these expressions in your script)

  • Use these expressions in a table that is dimensioned to ensure a single possible value for each of the metric sequence numers (eg include Month as a dimension).

Pick() expressions like these can be performance killers, so you may have performance issues if your data set is large.

Hope this helps you to get started...

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein