Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
kalai123
Contributor
Contributor

HO W TO CREATE DATE FIELD FROM DATA WITHOUT DATE

hii, iwant to find what is the max and min date from data , but my data was doesnt have the date ..

 

i have one column in my data called sold on.. in this sold on have only numbers like  42654.24 , from this iwant to find max and min of sales and also YTDdatadata

Labels (4)
3 Replies
Vegar
MVP
MVP

Your numbers, as 42654.24, are not dates but most likely timestamps. 42654 represents the date and the fraction .24 represents the time.

To convert the field into a date do this:

dayname(FieldName)

or this: date(floor(FieldName))

To find the max date do this:

dayname(max(FieldName))

or this: date(floor(max(FieldName)))

 

kalai123
Contributor
Contributor
Author

but my data will be like this, my requirements is i want to show the

max sales kpi, and YTD sales Screenshot (133).png

vinieme12
Champion III
Champion III

what you have is timestamps   example; 2022-10-12 10:09:00 AM

you need to create a NEW Date field by removing the time part

 

create a new datefield as below ; example

 

Fact:

Load  *

, Date(Floor(sold_on))  as sold_date

From SomeSourceFile.xlsx;

 

 

Then use below expressions to evaluate YTD and max based on sold_date field

 

YTD  = sum({<   sold_date={">=$(=Date(Yearstart(Max(sold_date)))) <=  $(=Date(Max(sold_date))) "}  >}   Sales )

 

Max  Date Sales = sum({<   sold_date={" $(=Date(Max(sold_date))) "}  >}   Sales )

 

Min Date Sales = sum({<   sold_date={" $(=Date(Min(sold_date))) "}  >}   Sales )

 

 

Vineeth Pujari
If a post helps to resolve your issue, please accept it as a Solution.