Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Need help on checking 2 columns and creating a count column.

Hi,

I have a report with follwong columns. My requirment is to show count of user_uid by checking steps column. The logic for count column is, it should only count when landingpage is follwed by registration_wall is follwed by any 3rd step(like logged_in or payment_details provided or purchase_submitted). if  this sequence is not followed then count is not taken. Expectd output is shown below for reference.

Expected output: 

StepCount of user_uid
landingpage6
registration_wall4
logged_in3
payment_details_provided2
purchase_submitted2

 

Thanks in Advance,

Neelofar.

  • Hi Anonymous ,

    Due to in your dax ,with "}",so return blank.delete the "{" and "}" in your dax ,and test again.And a little adjust.

    countuser = countrows(Filter(input,search("{landingpage,registration_wall",input[steps],,0) >0&&input[step]=EARLIER(input[step]) ||
    search( "{landingpage, registration_wall, logged_in}", input[steps],,0) >0 ||
    search( "{landingpage, registration_wall,logged_in,payment_details_provided}",input[steps],,0)>0 ||
    search( "{landingpage, registration_wall,logged_in,payment_details_provided,purchase_submitted}", input[steps],,0) >0 ))

    If not correct ,could you pls share your data in your first picture by  public link.

     

    Best Regards

    Lucien

     

4 Replies

  • Anonymous ,

    You need create a measure like this and add more conditions using or

     

    countrows(Filter(Table, search( "landingpage,registration_wall ", Table[Steps],,0) >0 ||   search( "landingpage, registration_wall, payment_details", Table[Steps],,0) >0 ||   search( "landingpage, registration_wall, payment_details, purchase_submitted", Table[Steps],,0) >0 ) )

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi amit,

      Thank you for the reply I tried your solution but I am gettiing blank values

       

      countuser = countrows(Filter(input,search("{landingpage,registration_wall}",input[steps],,0) >0 ||
      search( "{landingpage, registration_wall, logged_in}", input[steps],,0) >0 ||
      search( "{landingpage, registration_wall,logged_in,payment_details_provided}",input[steps],,0)>0 ||
      search( "{landingpage, registration_wall,logged_in,payment_details_provided,purchase_submitted}", input[steps],,0) >0 ) )

       

  • v-luwang-msft's avatar
    v-luwang-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    Due to in your dax ,with "}",so return blank.delete the "{" and "}" in your dax ,and test again.And a little adjust.

    countuser = countrows(Filter(input,search("{landingpage,registration_wall",input[steps],,0) >0&&input[step]=EARLIER(input[step]) ||
    search( "{landingpage, registration_wall, logged_in}", input[steps],,0) >0 ||
    search( "{landingpage, registration_wall,logged_in,payment_details_provided}",input[steps],,0)>0 ||
    search( "{landingpage, registration_wall,logged_in,payment_details_provided,purchase_submitted}", input[steps],,0) >0 ))

    If not correct ,could you pls share your data in your first picture by  public link.

     

    Best Regards

    Lucien

     

  • v-luwang-msft's avatar
    v-luwang-msft
    Icon for Community Support rankCommunity Support

    Hi Anonymous ,

    Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

    Best Regards
    Lucien