Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Not applicable

Filtering a variable

Hi Guys,

Ok so basically what im trying to do is get the Maximum date of a specific field in a variable

Set LastUnconfirmedSaleDate= =max( { 1 <Product={'*'}> , <ref = {'U'}>} Dates);

it must be for all products and the ref must be for U can someone correct my syntax/Logic ?

Regards

Curt

1 Solution

Accepted Solutions
jonbrough
Valued Contributor

Re: Filtering a variable

You don't need the middle angled brackets, so try:

Set LastUnconfirmedSaleDate= "=max( { 1 <Product={'*'},ref = {'U'}>} Dates)";

Jonathan

4 Replies
jonbrough
Valued Contributor

Re: Filtering a variable

You don't need the middle angled brackets, so try:

Set LastUnconfirmedSaleDate= "=max( { 1 <Product={'*'},ref = {'U'}>} Dates)";

Jonathan

MVP
MVP

Re: Filtering a variable

Hi,

Try this

LET LastUnconfirmedSaleDate= max( { 1 <Product={'*'} , <ref = {'U'}>} Dates);

Regards,

Jagan.

Not applicable

Re: Filtering a variable

Thanks that works , slightly off topic but is there a way to get the sum from only a single table

I.E. Set TotalAgents= =count({1} salesCode); I only want the count of salescode from oen table(agents) and not from the joining tables so i basically want to excludes sales codes from any other tables

jonbrough
Valued Contributor

Re: Filtering a variable

When you load in your tables create a duplicate of the field you are interested in, on the table you're interested in, and count that instead.

Else you can create a field with a value of 1 and do a sum on that field. That would be more efficient.

Jonathan

Community Browser