Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi, guys,
I`m new to QlickView and could not find an answer to my question.
I`m crating a pivot table to categorize our clients by how many products they have
I`ve tried this in dimension but it doesn`t work
=If (Count(DISTINCT([productName]))>3, '4 products',
if (Count(DISTINCT([productName]))>2, '3 products',
if (Count(DISTINCT([productName]))>1, '2 products ', '1 product ')))
Any suggestions?
Hey, easy with the reload button...
Moving that to the script might be as easy as the following
LOAD
If (Count(DISTINCT([productName]))>3, '4 products',
if (Count(DISTINCT([productName]))>2, '3 products',
if (Count(DISTINCT([productName]))>1, '2 products ', '1 product '))) AS Dimension
RESIDENT OriginalTable
GROUP BY SalesPerson;
Obviously, field names and table names are just an example, use your own.
Hope that helps.
Miguel
Hi,
Yes, if any, the following should do
=Aggr(If (Count(DISTINCT([productName]))>3, '4 products',
if (Count(DISTINCT([productName]))>2, '3 products',
if (Count(DISTINCT([productName]))>1, '2 products ', '1 product '))), Dimension2)
Anyway, I'd strongly recommend you to move that logic to the script, because calculated dimensions may have severe impact in your dashboard performance.
Hope that helps.
Miguel
Have you tried this in Add calculated dimention or in expression.
Try it there.
Thanks, Miguel,
and how to move that logic to script?
Thanks, Miguel,
and how to move that logic to script?
Thanks, Miguel,
and how to move that logic to script?
Hey, easy with the reload button...
Moving that to the script might be as easy as the following
LOAD
If (Count(DISTINCT([productName]))>3, '4 products',
if (Count(DISTINCT([productName]))>2, '3 products',
if (Count(DISTINCT([productName]))>1, '2 products ', '1 product '))) AS Dimension
RESIDENT OriginalTable
GROUP BY SalesPerson;
Obviously, field names and table names are just an example, use your own.
Hope that helps.
Miguel
Hey, Miguel,
One more question, I`ve loaded my data form txt file, where can i find the name of my table?
Hi,
Use the Table Viewer or Control + T when the document is open in the QlikView Desktop and you will see there your tables.
For what it's worth, get used to name your tables always in the load script, as follows:
Customers: // this is the table name
LOAD *
FROM Customers.qvd (qvd);
Hope that helps.
Miguel