Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
qlik_venu
Creator
Creator

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
antoniotiman
Master III
Master III

Try

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

View solution in original post

6 Replies
sunny_talwar

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)

qlik_venu
Creator
Creator
Author

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 ?

antoniotiman
Master III
Master III

Try

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

sunny_talwar

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

qlik_venu
Creator
Creator
Author

This worked as required.

Thanks a lot!!.

qlik_venu
Creator
Creator
Author

Thanks Sunny, the one from Antonio exactly worked.