How to compare the current date with the excel file column

Hi @lakshmi.mp ,

This is my understanding,

If date in that specific column is greater than today+5 date, those data alone needs to be written in another sheet right?

Thanks,
Sandhiya P

@sandhiya.ppp ,
yes correct…
Example:
today’s date = 09-10-2023 add 5 then 14-10-2023.
End date>= current date store into excel.
less than 14-10-2023 that needs to be removed…

@lakshmi.mp

you need to use write cell activity not writerange

if you want to use writerange then use assign activity inside then block

At last use writerange workbook

cheers

@Shiva_Nikhil ,
how to do this, can u elaborate on this.

Hi @lakshmi.mp ,

Like I mentioned earlier, you can use Add data row activity,

If you want to write it like a data table then you have to use Data row and add to data table activity.

  1. Build Data Table
  2. Create an Array or Datarow(if data row means, create variable of type System.data.datarow and initialize it DT.NewRow by giving in Assign condition.
  3. Now assign column1, column2 values whichever needed in new datable.
  4. Use Add data row to add values to data table
  5. Write data table to excel.

Second option,

  1. Check if condition, if True write “TRUE” in C Column using write cell activity.
  2. After for each activityuse filter data table to filter “TRUE” alone and write that data table into different Sheet.

Thanks,
Sandhiya P

@lakshmi.mp

check this

cheers

@Shiva_Nikhil ,
not filtering same issue.

Hi @lakshmi.mp ,

Can you please send us the error Screenshot.

or if possible can you please send me code.

Thanks,
Sandhiya P

@lakshmi.mp
share the screenshot or

share the sample input and expected output

i will send you the code

cheers

End date filter.xaml (13.0 KB)
@sandhiya.ppp please look into the attached workflow…

Hi,

I saw the flow, we should write DataTable only using write Range activity.

Can you please try below method,

  1. Check if condition, if True write “TRUE” in C Column using write cell activity.
    Note: In write cell give cell value “C”+Cint(Index+2).tostring
    This index value you should get it from For each activity properties.

  2. After for each activity use filter data table to filter “TRUE” alone and write that data table into different Sheet.

Please let me know if you face any issues.

Thanks,
Sandhiya P

1 Like

Hi @lakshmi.mp

Please find the below xaml

It is working total process

BlankProcess12.zip (71.6 KB)

Hope this helps!!

1 Like

Hope it is clarified @lakshmi.mp

If yes would recommend to close this topic

@Shiva_Nikhil @lrtetala @sandhiya.ppp @supriya117 Thanks a lot :slight_smile: for all your support and guidance.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.