Qlik Community

QlikView Layout & Visualizations

Discussion Board for collaboration on QlikView Layout & Visualizations.

Not applicable

Computations, Scripting and Expressions

Hi,

I have 2 sets of question and I would like to know your idea.

1. I have 2 pivot table, the 1st one was getting the sum of all sales.

ex:

DescSales
Sample1200
Sample2300
Sample3400
Total900

(this is just a sample, imagine it as a pivot table, my other dimension is month)

My second table compose of the percentage of the sales, it will depend on the total of the 1st table.

formula: sample1-> sales/total = percentage

DescSales
Sample122.2
Sample233.3
Sample344.4
Total100%

How can I produce this percentage if it is not joined to the 1st table?

2.) I have a date field and a list of customers and their item quantity.

Month
January 2012
February 2012March 2012
Customer NameQtyQtyQty
CustNo500
CustNo21215100
CustNo390200
CustNo4223023
CustNo5000

I need to filter this data who doesn't have a quantity for the last n months.

eg: Filter all the Customers who doesn't have any quantity for the last 2 Months [Date selected is February 2012(Included)]

output: CustNo5, since CustNo5 doesn't have any quantity from February2012~January2012

Note: I only have one Date Field.

I also want to know if it is better if I do it on Scripting or in the Chart

Thanks in advance!

-Donna

Tags (3)
3 Replies
chematos
Valued Contributor II

Re: Computations, Scripting and Expressions

I don´t understand the point 1 ... why do you need to separate the information in two tables?? Don´t they have the same dimensiones? You can use the option "Relative" in the options of the expressions sheet to get the percentages, else you need an expression using the same formula that table1 but adding sum(total Whatever) as denominator.

Question 2:  I would do it on scripting if the rule is always for the last 2 months, if the rule depends on the selection of the user, it should be done in the chart

hope this helps.

Regards

fosuzuki
Valued Contributor II

Re: Computations, Scripting and Expressions

Hi Donna,

I'm attaching a sample qvw I've created to check your item 2 requirement using set analysis. You can set the number of months for the calculation.

About item 2, I agree with Jose. Especially in cases when your calculation is complex, it is preferable to leave the heavy calculation "in the background" during the reload, so that the user experience is good when refreshing the charts.

Hope it helps you.

Fernando

Not applicable

Re: Computations, Scripting and Expressions

Alright, Thanks. I will try this one

Community Browser