Generate Tile Num and Tile Sequence

satishkurra
satishkurra Registered Posts: 10 ✭✭✭

Hi team

I'm trying to populate the Tile Num and Tile Sequence Number in the attached picture format. Trying to use windows recipe with no luck.

Can someone please help with this?

Attached is the data, the ask is to make sure generate a tile num for INS column. Highlighted the color combinations in the picture.


Operating system used: Browser

Tagged:

Best Answer

  • LouisDHulst
    LouisDHulst Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Neuron, Registered, Neuron 2023 Posts: 53 Neuron
    edited July 17 Answer ✓

    I have a solution with 2 window recipes and 1 prepare recipe, but it relies on the field RecordID being available and unique.

    1st Window Recipe:

    Define two windows:

    1. partition on INS and orderby RecordID (ascending order)
    2. order by RecordID (ascending order)

    For aggregations, compute Sum of INS.

    Prepare Recipe:

    Use a formula processor with the formula

    if(INS == 1, INS_sum * 2, if(w2_INS_sum == 0, 1, w2_INS_sum * 2 + 1))

    This gives you Tile_Num

    2nd Window Recipe:

    Only a single window: partition by Tile_Num and order by RecordID (ascending), then compute the Rank. This gives you Tile_SequenceNum

Answers

Setup Info
    Tags
      Help me…