Jump to content

Passing value to HTML table according to date


Mohd faizal Adris

Recommended Posts

I have an HTML table in the Text area which containsdate information thatwill change dynamically based on the fiscal week.

 

What I'm trying to do is to make the tablecontents change its values according tothe date value inside the table header respectively.

I had tried usingcalculated values but it not solve my problem. Any suggestions

Link to comment
Share on other sites

You can use the following expression to get the header (dates for thisweek) as:

#10th May

DateAdd("week",Week(DateTimeNow()) - 1,Dateadd("day",0-DayOfWeek(DATE(Year(DateTimeNow()),1,1)),DATE(year(DateTimeNow()),1,1)))

 

#11th May

DateAdd("week",Week(DateTimeNow()) - 1,Dateadd("day",1-DayOfWeek(DATE(Year(DateTimeNow()),1,1)),DATE(year(DateTimeNow()),1,1)))

 

#12th May

DateAdd("week",Week(DateTimeNow()) - 1,Dateadd("day",2-DayOfWeek(DATE(Year(DateTimeNow()),1,1)),DATE(year(DateTimeNow()),1,1)))

 

#13th May

DateAdd("week",Week(DateTimeNow()) - 1,Dateadd("day",3-DayOfWeek(DATE(Year(DateTimeNow()),1,1)),DATE(year(DateTimeNow()),1,1)))

 

#And so on..Also, in the column values, you can use calculated values and use case statements to get the required values. For example, to get the Sum value for apple on 11th May, you can use the following expression (Assuming the column name is same in the data table):

Avg(Case

When [item]="Apple" and ([Date]=DateAdd("week",Week(DateTimeNow()) - 1,Dateadd("day",1 - DayOfWeek(DATE(Year(DateTimeNow()),1,1)),DATE(year(DateTimeNow()),1,1)))) Then Count([item])

End)

Link to comment
Share on other sites

Hi Shashank,

 

I had tried to replicate your solution but the calculated values didn't return any result after the following expression being added. Please help to guide me.

 

case  

WHEN ([Remark]="Material Expire With In 30Days") And ([Expired Date]=DateAdd("week",Week(DateTimeNow()) - 1,Dateadd("day",1 - DayOfWeek(DATE(Year(DateTimeNow()),1,1)),DATE(year(DateTimeNow()),1,1)))) THEN Count([Remark])

END 

 

 

 

calculated_values.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...