Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
Leverage your QlikView investment to modernize BI – see how! Join Group
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor III
Contributor III

set operator variable with in the set

Hi,

This is in continuation to a query I had got solution yesterday.

This worked fine for me.

Count({<Item_id={"=Sum(Sales) <> 0"}>} distinct Item_id)

The above works perfect for me.

Now I have to pass a variable in the set operator. Can you please suggest me on this.

Something as below, this doesn't work though

ount({<Item_id={"=Sum( {< Year = {"$(Max_Year"}>}Sales) <> 0"}>} distinct Item_id)

Thanks,

Venu

1 Solution

Accepted Solutions
Highlighted
Master III
Master III

Re: set operator variable with in the set

Try

Count({<Item_id={"=Sum( {< Year = {'$(=Max_Year)'}>}Sales) <> 0"}>} distinct Item_id)

View solution in original post

6 Replies
Highlighted

Re: set operator variable with in the set

May be this:

Count({<Item_id = {"=Sum({<Year = {"$(=Max_Year"}>}Sales) <> 0"}>} DISTINCT Item_id)

or

Count({<Item_id = {"=Sum({<Year = {"$(=$(Max_Year)"}>}Sales) <> 0"}>} DISTINCT Item_id)

Highlighted
Contributor III
Contributor III

Re: set operator variable with in the set

Thanks for reply.

When I use a double quote within a double quote, the expression breaks and I also get no outputs in the chart.

I also tried using a chr(34) instead of the double quote, with a ' and & for the rest, but for some reason it doesn't get to work..

Any suggestions ?

Highlighted
Master III
Master III

Re: set operator variable with in the set

Try

Count({<Item_id={"=Sum( {< Year = {'$(=Max_Year)'}>}Sales) <> 0"}>} distinct Item_id)

View solution in original post

Highlighted

Re: set operator variable with in the set

That's true, try without the inner double quote:

Count({<Item_id = {"=Sum({<Year = {$(=Max_Year)}>}Sales) <> 0"}>} DISTINCT Item_id)

or

Count({<Item_id = {"=Sum({<Year = {$(=$(Max_Year))}>}Sales) <> 0"}>} DISTINCT Item_id)

Also added the closing parenthesis which I missed in my first response

Highlighted
Contributor III
Contributor III

Re: set operator variable with in the set

This worked as required.

Thanks a lot!!.

Highlighted
Contributor III
Contributor III

Re: set operator variable with in the set

Thanks Sunny, the one from Antonio exactly worked.