Count in numbered list

Hello everyone, 

 

I am facing a problem in counting the same names in numbered list. Let me explain with pictures,

I have a numbered list :- Style. In this list, every member has different code but multiple members has the same Display name property as shown in the picture below.

Screenshot 2022-06-14 at 10.44.17 AM.png

I have a module "Module M1", where this list is used as dimension and I have two line items, 1. Boolean1, 2. Count.

Screenshot 2022-06-14 at 10.44.02 AM.png

Boolean1 is true for many styles which have same name but I want to count them as only 1 if they have same name as shown in the picture "Actual Count". I have tried firstoccurrence formula but it ignores the styles if its first occurrence in the list doesn't have Boolean1 - true. I have tried RANK formula in two other line items like one with sequential rank and other with minimum rank, compared them but it didn't work. These two line item didn't show the same values so that I can compare them and use IF ELSE statement.

Have a look at this problem and share your solution. Your help will be much appreciated. 

 

Thanks!

Shubham

Best Answer

Answers

  • Hi Shubham,

     

    I think the below solution will work.

    Create one list for display name called "Style Type"

    Pooja_2-1655190549139.pngPooja_3-1655190663795.png

    Let me know if you need any clarification.

     

    Thanks

    Pooja

     

  • I am getting all the values as 1 for the rank logic
  • @Pooja 

    Hi Pooja, 

    I think this solution can work but in the given example there are only 4-5 style names but the model that I am working on has 30000+ styles. Roughly, there would be 10000 unique style display names. How do you suggest to create this new list? Also, currently the boolean1 has a formula which is applicable on style list. Would it work with a different list as it is working now?

     

    - Shubham

  • @Pooja 

    Also try unchecking first Style 1 and Style 2. I think the formula won't work.

  • @ShubhamCh 

     

    @Pooja was on the correct track, create a flat list of all Styles using the code (10,000 will not be too many).  On the transaction list, set the Display Name property to the above Style flatlist.  Create a module (TRANS Module), using the transactional list (Trans List), create a line item named Count? with the formula isfirstoccurrence(Trans List.Display Name, Trans List).  Create another line item named Actual Count with the formula, if count? then 1 else 0.  Create another module dimensionalized by Styles Flat, with a line item called Total with the formula: Trans Module.Count[sum:Trans List.Display Name].

     

    Rob

  • @ManjunathKN 

    Thanks Manjunath! Yours was the easiest method to solve this problem.👍

     

    Thanks @Pooja @rob_marshall for helping me. Kudos to you too😊.

     

    - Shubham