I'm attempting to change the dates on some data within Wave Analytics to get the correct time zone showing, but I'm getting the error "Incompatible types: STRING and NUMERIC" whenever I attempt the SAQL in either an SAQL query or through the dataflow.

As an example, here is pulling the data normally: enter image description here

And then here is it going wrong after trying to amend the time: enter image description here

I've checked the developer SAQL guide and it looks correct, so I'm a little stuck on where to proceed from here.

Thanks in advance!

  • What guide are you looking in that said you can use the string 'createdDate' and add a number to it and somehow magically a date pops out? Can you link to the example because toDate is defined as toDate(DATE , FORMATSTRING) or toDate(STRING,FORMATSTRING) - createdDate as a string cannot be converted to a date with or without trying to append numbers to it – Eric Nov 23 '16 at 4:11
  • I was looking at this one: developer.salesforce.com/docs/#working_with_time_zones I'll try without the quotes and see how it goes! – Ryan Etherington Nov 23 '16 at 4:22
  • See my answer. which follows the instruction here: developer.salesforce.com/docs/… - working with time zones. your link does not work and if it is the same does not include quotes around the field token – Eric Nov 23 '16 at 4:24

I believe you are looking for

toDate(createdDate + 11*3600)

or maybe

toDate(CreatedDate_sec_epoch + 11*3600)

might be more appropriate since you are adding 11 hours worth of seconds

sans the quotes around createdDate making is a field reference instead of a string

| improve this answer | |
  • I've attempted both, still getting the same error unfortunately. – Ryan Etherington Nov 23 '16 at 4:35
  • Not sure how you can get the same error as there are not STRINGS in posted code thus the error should at least be different – Eric Nov 23 '16 at 5:27

Wave takes dates and splits them up into their individual components (year month, day, epoch etc). You can only do this if you are trying to add to the created date epoch field.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.