I want to show my data week wise

I have created a some formula to show my data in weekwise like week1, week2,week3 …etc instead showing like data 3 mar 2024, 15 mar 2024,… etc.

dateDiff(truncDate(“WK”, truncDate(‘2023’, {CreateDate})), {CreateDate}, ‘WK’)+1

My formula shows below error
Expression truncDate(“WK”, truncDate(‘2023’, {CreateDate})) for function truncDate has incorrect argument type truncDate(String, Date). Function syntax expects String (Period), Date.

My columns

Expected column name

Please help me on this

Thanks,

Hello @hripraa,

I believe your error is due to “2023” in the calulated field. It should be a period of the date, such as “YYYY”. For example:

dateDiff(truncDate("WK", truncDate"YYYY", {CreateDate})), {CreateDate}, "WK")+1
1 Like

@Kelseykl Thank you so much

1 Like

@Kelseykl Is there any way where we can add the string with it because currently which is only showing the week number alone but i want like week1, week2, week3 …etc

Hi @hripraa, yes you can add concat to the front of the calculated field, but you will have to ensure the Week # is converted to a string for it to work. For example:

concat("Week ", toString( dateDiff(truncDate("WK", truncDate"YYYY", {CreateDate})), {CreateDate}, "WK")+1 ))