Forum Discussion

  • peiyezhu's avatar
    peiyezhu
    Bronze Contributor

    A_SIRAT 

     

    How about this?

     

    https://b23.tv/PYAnjYh 

     

    create temp table aa as 
    select udf_fillna_m(iif(f07 like 'Week:',f08,''),'x') Week,udf_fillna_m(iif(f07 like 'Order nr:',f08,''),'y') Order_nr,udf_fillna_m( iif(f07 like 'Customer:',f08,''),'z') customer, iif((f03 like '-') or (f03 is null),'',f03) f03,iif((f03 like '-') or (f03 is null),'',f04) f04,iif((f05 like '-') or (f05 is null),'',f05) f05,iif((f05 like '-') or (f05 is null),'',f06) f06,iif((f07 like '-') or (f07 is null) or ( regexp('Week|Order nr|Customer',f07)),'',f07) f07,iif((f07 like '-') or (f07 is null) or (regexp('Week|Order nr|Customer',f07)),'',f08) f08 from consolidateSheet;
    select Week,Order_nr,customer,f04 Variety_Name,f03 Quantity from aa where f03!='' union all 
    select Week,Order_nr,customer,f06,f05 from aa where f05!='' union all 
    select Week,Order_nr,customer,f08 ,f07  from aa where f07!=''

     

    • A_SIRAT's avatar
      A_SIRAT
      Iron Contributor
      Hi,

      You seem to have a solution but is this excel ?
    • A_SIRAT's avatar
      A_SIRAT
      Iron Contributor
      Thank you !.
      This has done exactly what I want.
      Would you mind to share the steps then I will do more practice.

      • Lorenzo's avatar
        Lorenzo
        Silver Contributor

        A_SIRAT 

        Would you mind to share the steps then I will do more practice

        Which step(s) causes you a challenge?

         

        (Power Query doc. is available here)

    • A_SIRAT's avatar
      A_SIRAT
      Iron Contributor
      I thought I would get a chance to mark it as Best Response since I started the discussion. Anyway, I would have done it again....was just waiting for your second feedback.

Resources