Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
here in above image the datatype used in database is user defined ie Money. Now when I am writing an expression its not giving correct result. Following is the expression :-
=sum({< Sold_Date = {">=$(From)<=$(To)"} >}[inv value] )
can be seen in the below image
But if I am using expression as sum([inv value] its giving me correct answer
and for conversion I have used following in the script.
Date(vouch_date, 'YYYY-MM-DD') as Sold_Date,
Please help
Well, you can format it back to your previous format
Date(Date#(Sold_Date, 'YYYY-MM-DD'), 'YYYY-MM-DD') ad Sold_Date
But the question is, is your expression now working? If yes, job done. If not, my assumption was wrong and we need to work further.
If the expression is not working, please go the the output table and expand the expression column so that we see what is in the label row. This should contain $(From) and $(To) variables evaluated, which can give us a hint...
Optionally, can you format those variables to YYYY-MM-DD format (or your Sold_Date to DD/MM/YYYY format)?
Juraj
I have done following changes in the script
Date(Date#(vouch_date, 'YYYY-MM-DD'),'YYYY-MM-DD')as Sold_Date,
I am taking from last discussion. You can try?
Date(Num#(vouch_date),'YYYY-MM-DD') as Sold_Date
That doesn't work because the date field in your data is formatted differently (i.e. not 'YYYY-MM-DD'). Can you please open up your source file and check how the data in the field "vouch_date" is formatted? With the Date# function you are telling Qlikview that your source data is in the format 'YYYY-MM-DD' which is clearly not because the result data after the load is blank (according to the screenshot you've attached in your last post).
Here the date is in the same format as mentioned n the script.
The date format in your variables is different from your data. Use this in your script:
date(date#(vouch_date,'YYYY-MM-DD hh:mm:ss[.fff]'),'DD/MM/YYYY') as Sold_Date,
This is giving no result
can you provide a screenshot of the source data, not the qlikview tables. Excel, csv, etc. It would be good to understand in what format the data is coming into qlikview
Try this:
date(floor(vouch_date),'YYYY-MM-DD') as Sold_Date,
then in UI try like this:
=sum({< Sold_Date = {">=$(=Date($(From), 'YYYY-MM-DD'))<=$(=Date($(To), 'YYYY-MM-DD'))"} >}[inv value] )
Just check the out put of both the variables in a text box to be sure:
1. Date($(From), 'YYYY-MM-DD')
2. Date($(To), 'YYYY-MM-DD')
Br,
KC