Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
user-azadi
Contributor III
Contributor III

instead of Timestamp sql function in QV Load Script

Hello All...

i have this syntax in sql syntax :

----------------------------------------------

SQL

SELECT

   Year

  ,Month

  ,GacBranchRef

,GacSecondDetailAccountRef

,GacFourthDetailAccountRef

,sum(Credit) - sum(Debit) as mandeh

      , Date(Floor(Timestamp(item.VoucherDate,'DD/MM/YYYY hh:mm:ss')),'DD.MM.YYYY') as VoucherDate

FROM

----------------------------------------------

when i run that  in qv script , don't identify Timestamp function (and maybe Date function) .because sql haven't Timestamp function, and maybe Date function)

what must i to do?

12 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

Try this using the preceding load.

Load

Year

  ,Month

  ,GacBranchRef

,GacSecondDetailAccountRef

,GacFourthDetailAccountRef

,mandeh,

Date(Floor(item.VoucherDate),'DD/MM/YYYY') as VoucherDate;

SQL

SELECT

   Year

  ,Month

  ,GacBranchRef

,GacSecondDetailAccountRef

,GacFourthDetailAccountRef

,sum(Credit) - sum(Debit) as mandeh

      ,item.VoucherDate

FROM

Regards,

Kaushik Solanki

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
rohitraut
Creator
Creator

Hello ,

Try this

SQL

SELECT

   Year

  ,Month

  ,GacBranchRef

,GacSecondDetailAccountRef

,GacFourthDetailAccountRef

,sum(Credit) - sum(Debit) as mandeh

      , Date(Floor(TO_CHAR(item.VoucherDate,'DD/MM/YYYY hh:mm:ss')),'DD.MM.YYYY') as VoucherDate

FROM

user-azadi
Contributor III
Contributor III
Author

Dear Rohit

with use To_Char function , show error message in qv script.

user-azadi
Contributor III
Contributor III
Author

expression of fied "mandeh" is

sum(Credit) - sum(Debit) as mandeh

and in output qv , show zero value.this mean calculate in sql section , don't work in load section.


rohitraut
Creator
Creator

What is error message

user-azadi
Contributor III
Contributor III
Author

error.png

rohitraut
Creator
Creator

Try this ,

SQL

SELECT

   Year

  ,Month

  ,GacBranchRef

,GacSecondDetailAccountRef

,GacFourthDetailAccountRef

,sum(Credit) - sum(Debit) as mandeh

      , Date(Floor(To_Timestamp(item.VoucherDate,'DD/MM/YYYY hh:mm:ss')),'DD.MM.YYYY') as VoucherDate

FROM

user-azadi
Contributor III
Contributor III
Author

error.png

rohitraut
Creator
Creator

SQL

SELECT

   Year

  ,Month

  ,GacBranchRef

,GacSecondDetailAccountRef

,GacFourthDetailAccountRef

,sum(Credit) - sum(Debit) as mandeh

      , Date(Floor(Date#(item.VoucherDate,'DD/MM/YYYY hh:mm:ss')),'DD.MM.YYYY') as VoucherDate

FROM