Forum Discussion

Nick2's avatar
Nick2
Frequent Visitor
8 years ago

Duplicate to null and date to integer

Hey Guys,

 

I have the issue, that my data involves dates, some with duplicates, some without. Now what I need/want to do, is:

1.  instead of deleting the duplicates make them to null values.

2. tranform all the remaining date values into integer.

 

Thanks for the help, cheers!

 

Nick

3 Replies

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi Nick2,

     

    You could achieve this in Query Editor by the steps below.

     

    1. Go to Query Editor and select the Date column and click Group By like below.

     

     

    2. Then select Date and Count, click Unpivot  Columns and you will get the values below;

     

     

    3. Replace the value 2 to null and remove other columns.

     

     

     

    4.Filer the values without 1.

     

     

    5. Change Date type to Whole number.

     

     

    For reference, you could have a look at my test file which has been attached below.

     

    Best Regards,

    Cherry

  • v-piga-msft's avatar
    v-piga-msft
    Resident Rockstar

    Hi Nick2,

     

    Have you solved your problem?

     

    If you have solved, please always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

     

    If you still need help, please feel free to ask.

     

    Best Regards,

    Cherry

    • Nick2's avatar
      Nick2
      Frequent Visitor

      Hi v-piga-msft,

       

      tahnks for the quick answer, I'm sorry it took me so long to reply. Sadly your answer doesn't quit fix the problem, which is my fault as I wasn't precise enough. My Data looks like this:

      DateSpace
      11.06.2018A
      12.06.2018B
      13.06.2018A
      13.06.2018A+C
      14.06.2018B
      14.06.2018C
      15.06.2018C
      16.06.2018 
      17.06.2018A
      17.06.2018B
      17.06.2018C

      Now there are always three rooms available (A,B,C) but not always booked and I need to know how booked we actually are. My idea was to find this out, by replacing the date with a 3, the letter with a 1, take the sums and divide the values. This obviously means, that:

      1. I need to remove the dates that are more often named then one (two or three times, I misused the word duplicate, sry!) but without deleting them as I need the information from the other column. Which is why I wanted to transform them into null values.

      2. change the remaining date values to 3 (as in reallity those are way more, without addressing all of them single handly)

       

      I hope this clarifys the issue, again I'm sorry if I wasn't precise enough and I hope you'll still be able to help out.

       

      greetings, Nick