Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Min | Max | Score |
---|---|---|
0 | 10 | 0 |
11 | 50 | 25 |
51 | 100 | 50 |
101 | 250 | 75 |
251 | 1000 | 100 |
Found time for this after all... See attached, based on your Excel file.
The expression is:
max(if([Min Sales]<=aggr(sum(Sales),Ingredient, [Min Sales]), Score))
Regards,
Michael
Sorry, I meant to say where the sum of the sales aggregated over the dimensions falls between the Min and Max for a particular score.
Tom,
I'm not sure what exactly you need... Anyway take a look at the column(n) function, maybe it will help. Or upload an example.
Regards,
Michael
I usually use FisrtSortedValue() function as alternative to lookup function.
Michael,
I've attached an example of how I would do this in Excel. Tables 1 (Product, Type, Sales) and 2 (Product, Ingredient) would be loaded into QlikView and joined on the Product field as represented in the third table. Table 4 (Min Sales, Score) would be loaded separately in QlikView and would be used to score the aggregate sales for each ingredient, potentially based on a selection of Product Type. You can see the aggregated sales by ingredient in Table 5 (which would be a Straight table in QlikView). In the Score column, you can see how I've used the Excel Vlookup function to find a Score in the Lookup table (table 4) where the aggregated sales by ingredient (potentially limited by a selection of Product Type) are greater than the first Min Sales value sorted in ascending order.
I don't see a clear way to do this in QlikView.
Tom
I see now what you want to get the greatest Score value where MinSales doesn't exceed Total result. The logic (not the solution) is like this:
max(if(MinSales<=Total) Score))
I'll try to find time to come up with an example based on your table.
Regards,
Michael
Found time for this after all... See attached, based on your Excel file.
The expression is:
max(if([Min Sales]<=aggr(sum(Sales),Ingredient, [Min Sales]), Score))
Regards,
Michael
Aggr function would be helpful.
thanks,
Rajesh Vaswani
Sure - and it is right there in my example 🙂
Michael,
Thanks. That worked perfectly.
TB