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: 
sakshikaul
Creator II
Creator II

Expression is giving no result

paint.png

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

PAINT2.png
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

24 Replies
juraj_misina
Luminary Alumni
Luminary Alumni

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

sakshikaul
Creator II
Creator II
Author

I have done following changes in the script

Date(Date#(vouch_date, 'YYYY-MM-DD'),'YYYY-MM-DD')as Sold_Date, PAINT2.png

Anil_Babu_Samineni

I am taking from last discussion. You can try?

Date(Num#(vouch_date),'YYYY-MM-DD') as Sold_Date

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
lorenzoconforti
Specialist II
Specialist II

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).

sakshikaul
Creator II
Creator II
Author

Here the date is in the same format as mentioned n the script.paint.png

lorenzoconforti
Specialist II
Specialist II

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,

sakshikaul
Creator II
Creator II
Author

This is giving no result

lorenzoconforti
Specialist II
Specialist II

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

sakshikaul
Creator II
Creator II
Author

paint.png

jyothish8807
Master II
Master II

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

Best Regards,
KC