Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Problem in setanalysis

Hi,

I have problem in set analysis.

I have 3 dimensions like category ,product_id,listing_id.

Each product has one or more than listing id's.

I need to show in straight table below two expressions.

In first expression i need to show product count of listing id's count having one and like in another expression also count of pid's having listing count is 2.

CategoryProduct id count for listing id count is 1 for for productProduct id count having lisitng id count 2 for product

Could you please help on setanalysis expression?

Thanks,

Rajesh

9 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Do you mean that you want the products which has only one Listing ID and in other expression you want Product Count where Listing count is 2.?

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

HI These are 2 expressions 1)count of products having lisitng_id count is 1

                                          2)count of products haing lisitng_is count is 2

Anonymous
Not applicable
Author

Yes exactly

jagan
Partner - Champion III
Partner - Champion III

HI,

Try like this

ListingID Count is 1:

Sum(Aggr(If(Count(Distinct Listing_ID) = 1, 1, 0), Product_ID))

ListingID Count is 2:

Sum(Aggr(If(Count(Distinct Listing_ID) = 2, 1, 0), Product_ID))


Hope this helps you.


Regards,

jagan.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Then create a straight table with dimension as Category.

Expression 1.

Count({<Product = {'=count(listing_id) = 1'}>}Product)

Expression 2:

Count({<Product = {'=count(listing_id) = 2'}>}Product)


Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Hi Kaushik,

Thanks for your replay.

In above expression Count(lisitng_id)=1 means it will take whole count of products but we need to filter here also with pid for coutn(lisitng_id)=1.

Anonymous
Not applicable
Author

Thanks for the replay Jagan.

I am checking your expression ,let you know once it matched.

kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Dear Rajesh,

What the expression will give is like this.

It will give all the products where the count of ID is 1 and then count such Products.

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Anonymous
Not applicable
Author

Thanks it's working fina