2 Replies Latest reply on Sep 6, 2018 10:07 AM by Michael Ye

# Grouping the Product IDs as available or unavailable based on the availability flag.

I have these 4 columns:  Country, Product ID, PriceList Name and Availability.

In a specific country there are specific Price List names(One or more than one. Varies from Country to Country). So the Product IDs whose availability flag is "Y", even for one of the Price List Name, then it's  considered as "Available". It will be considered as "Unavailable" only if the availability is "N" for all the price list Name. I'm not sure how to  do the calculation part to achieve this result. Please help me with the solution.

• ###### 1. Re: Grouping the Product IDs as available or unavailable based on the availability flag.

Hi Jayeeta,

You can try below approach:

Count = { FIXED [Country],[Product ID]:COUNTD([Availability Flag])}

Flag =

if [Count]=1 and [Availability Flag]="Y" then "Available"

elseif [Count]=1 and [Availability Flag]="N" then "Un-Available"

ELSE "Available" END

4 of 4 people found this helpful
• ###### 2. Re: Grouping the Product IDs as available or unavailable based on the availability flag.

Jayeeta,

Make a calculated field: PIDs Availability

IF { FIXED [Country],[Product ID]:SUM

(IF [Availability Flag]='Y' THEN 1 ELSE 0 END)}>0

THEN 'Available' ELSE 'Unavailable'

END

Hope it helps.

Michael Ye

7 of 7 people found this helpful