Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

pradosh_thakur
Honored Contributor 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.
Tags (1)
1 Solution

Accepted Solutions

Re: expression showing zero value

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
Esteemed Contributor III

Re: expression showing zero value

try this

what is the date format ?


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

MVP
MVP

Re: expression showing zero value

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.

Re: expression showing zero value

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

pradosh_thakur
Honored Contributor II

Re: expression showing zero value

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
Honored Contributor II

Re: expression showing zero value

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.

Re: expression showing zero value

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

Re: expression showing zero value

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)

Re: expression showing zero value

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