Skip to main content
Announcements
The way to achieve your own success is the willingness to help somebody else. Go for it!
cancel
Showing results for 
Search instead for 
Did you mean: 
pradosh_thakur
Master II
Master II

expression showing zero value

=sum({<[Invoice Period]={" $(=date(MAX([Invoice Period]),'YYYY-MM'))"}>}[Actual Total]) is working but

=sum({<[Invoice Period]={"<= $(=date(MAX([Invoice Period]),'YYYY-MM'))"}>}[Actual Total]) is showing zero

object : textbox

tool :qlikview 12.x

regards

Pradosh

Learning never stops.
1 Solution

Accepted Solutions
Anil_Babu_Samineni

In fact, I thought same earlier, I thought to ask stalwar1‌ or hic fortunately i missed that. Someway, I got to know the issue

=sum({<[Invoice Period]={"<=$(=date(MAX([Invoice Period]),'YYYY-MM'))"}>}[Actual Total]) is showing zero

Here, What i understand is Set analysis with some spaces won't allow. If you remove i believe this should work. Not really sure what is the cause..

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)

View solution in original post

8 Replies
Chanty4u
MVP
MVP

try this

what is the date format ?


=sum({<[Invoice Period]={'<= $(=date(MAX([Invoice Period]),'YYYY-MM'))'}>} Dsiticnt [Actual Total])

tresesco
MVP
MVP

This could be because your YYYY-MM formatted [Invoice Period] is possibly a text field. Text field comparison could work with '=' but not really with '<='. Ideally, you should create a dual date field in the script.

Anil_Babu_Samineni

In fact, I thought same earlier, I thought to ask stalwar1‌ or hic fortunately i missed that. Someway, I got to know the issue

=sum({<[Invoice Period]={"<=$(=date(MAX([Invoice Period]),'YYYY-MM'))"}>}[Actual Total]) is showing zero

Here, What i understand is Set analysis with some spaces won't allow. If you remove i believe this should work. Not really sure what is the cause..

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
pradosh_thakur
Master II
Master II
Author

Thank you for your suggestion.

It's a date and it is working  fine now after i followed Anil's suggestion and removed the space.

strange!!

regards

Pradosh

Learning never stops.
pradosh_thakur
Master II
Master II
Author

Strange !! thats the case here. I have never encountered this bug(if it is a bug) before. its working fine now Anil. let me experiment a little and i will close the thread.

regards

Pradosh

Learning never stops.
sunny_talwar

Yes, Anil is right, for some reason spaces after <=, <, >, >= and before $() cause the expression to now work.... so don't have them

Anil_Babu_Samineni

Any reason, What it could be and If we use in script looks like we've got as expected like

If(Field <= 10, 1,0)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
sunny_talwar

So, let me clarify... the issue is related to spaces in set analysis... for example

Sum({<Number = {"> 10 < 15"}>} Sales)

vs

Sum({<Number = {">10<15"}>} Sales)

I have not done any testing, but I think first expression won't work because of spaces, while the second one will... when I say it won't work, I mean it will just ignore set analysis on Number field....