4 Replies Latest reply: Oct 13, 2017 7:21 AM by Mohammed Mukram RSS

    How to create a calculated field and populate it with a specific value

    Ben Gardon

      Hi everyone,

      I'm new to Qlik Sense and have found this forum extremely helpful. Unfortunately I cannot find an answer to my specific problem below:

       

      I have a spreadsheet that consists of many Sales Order numbers. Each Sales Order number consists of many part numbers making up the entire order. The list of part numbers for each Sales Order number consists of a "primary system type" part number along with a number of "Options" part numbers. I've attached a simplified version of what I am looking at to provide clarification.

      SALES_ORDER_NUMBERPART_NUMBERSYSTEM_TYPE

      100

      Option_1
      100Option_2
      100System_Type_1
      100Option_3
      500Option_1

      500

      System_Type_2
      500Option_2
      500Option_3
      500Option_4
      700System_Type_3
      700Option_1
      700Option_2
      700Option_3

      In the original spreadsheet the SYSTEM_TYPE column doesn't exist. I would like to create this column in the script and populate the cells with the "primary system type" part number for all rows containing the same Sales Order Number. Below is the end result I am trying to get to:

      SALES_ORDER_NUMBERPART_NUMBERSYSTEM_TYPE
      100Option_1System_Type_1
      100Option_2System_Type_1
      100System_Type_1System_Type_1
      100Option_3System_Type_1
      500Option_1System_Type_2
      500System_Type_2System_Type_2
      500Option_2System_Type_2
      500Option_3System_Type_2
      500Option_4System_Type_2
      700System_Type_3System_Type_3
      700Option_1System_Type_3
      700Option_2System_Type_3
      700Option_3System_Type_3