# How to convert an int to a date type Year Week number?

**URL:** <https://forum.inductiveautomation.com/t/how-to-convert-an-int-to-a-date-type-year-week-number/59596>\
**Category:** General Discussion\
**Tags:** ignition81, database, scripting\
**Created:** [May 16, 2022, 7:32am UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-int-to-a-date-type-year-week-number/59596 "2022-05-16T07:32:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![RH\_AMINE](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@RH\_AMINE](https://forum.inductiveautomation.com/u/RH_AMINE)\
**Post date:** [May 16, 2022, 7:32am UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-int-to-a-date-type-year-week-number/59596/1 "2022-05-16T07:32:51Z")

</div>

hello  
i want to convert int to the year week number.  
i am ploting result of a query that contain [“YearWeek”,“Performance”] as columns , in timeSeries Chart,  
but the YearWeek column has an int type in the database , so it result an error when ploting because no time column.

thank you

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [May 16, 2022, 3:06pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-int-to-a-date-type-year-week-number/59596/2 "2022-05-16T15:06:24Z")

</div>

Use the XY chart, rather than the time series chart?

In theory, with [`system.date.parse`](https://docs.inductiveautomation.com/display/DOC81/system.date.parse), the [`w`](https://docs.inductiveautomation.com/display/DOC81/Data+Type+Formatting+Reference) format code, and probably at _least_ the known year, you could turn a week number into an actual date object, but it’s probably not actually necessary or helpful to do so.

---

<div class="post-metadata">

**Author:** ![RH\_AMINE](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@RH\_AMINE](https://forum.inductiveautomation.com/u/RH_AMINE)\
**Post date:** [May 17, 2022, 6:49am UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-int-to-a-date-type-year-week-number/59596/3 "2022-05-17T06:49:21Z")

</div>

thank you for your response,

> Blockquote  
> Use the XY chart, rather than the time series chart?

XY chart dosn't plot it like i need , it gives me this for more then two columns:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/8/3/837be0220adf7b794cd9be9cff05eaa71d343113.png)

and in some case i have more than 10 columns , i don't know how to stacke them (i checked " stacked" for each serie )

> Blockquote  
> you could turn a week number into an actual date object,

yes i have the year too, so that's what i did for now.  
my dataset is from a query response.

---

<div class="post-metadata">

**Author:** ![RH\_AMINE](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@RH\_AMINE](https://forum.inductiveautomation.com/u/RH_AMINE)\
**Post date:** [May 17, 2022, 1:12pm UTC](https://forum.inductiveautomation.com/t/how-to-convert-an-int-to-a-date-type-year-week-number/59596/4 "2022-05-17T13:12:09Z")

</div>

[XY Stacked Bar Chart](https://forum.inductiveautomation.com/t/stacked-bar-chart-in-perspective-detailed-steps/47107)  
this helped me a lot to figure out how stack the columns
