Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
hobanwashburne
Creator
Creator

Set Analysis syntax

Bear with me, I'm new to this.

I have the following expression which seems to work for the sum of net sales during fiscal period 201212

=sum({<FiscalPeriod = {"201212"} >}NetSales)

However, the following expression does not work for the sum of net sales between fiscal periods 201212 thru 201302

=sum({<FiscalPeriod = {">=201212 <=201302"} >}NetSales)

What am I missing?

//----------------------------------------------------------------------------------------------------------------

For some reason I can’t reply on
this post… anyway

Sorry to say guys, none of the
suggestions have worked. (BTW Steve, I believe you left out a single quote in
your expression.) I would rather not post the actual file due to size and the
fact that it is our company's financial data. However, I would really like to
know what is going on.

As far as a possible bug goes, I'm
running v10.00.8715.5 IR 64-bit Edition (x64)

I have the dates formatted in the
table load as follows:

Date#(SLGLPR,'YYYYMM') as FiscalPeriod,

and the initial load as

DateFormat='YYYYMMDD';

I changed the initial load to the
following, but it had no effect

DateFormat='YYYYMM';

6 Replies
Not applicable

Try single quotes =sum({<FiscalPeriod = {'>=201212 <=201302'} >}NetSales).

That should work

sathishkumar_go
Partner - Specialist
Partner - Specialist

Hi, Could you please attache the application here? Regards Sathish

Not applicable

Single quotes should do it.


However, I believe I encountered a bug with a similar model of mine, where I could not get the syntax to work out (and I spent days and involved an external consultant who couldn't figure out the issue).  So my rather ugly get out was the below formula (only use this as a last resort as I'm sure the performance is far from optimal).



=sum({<FiscalPeriod = {'>=201212'} * FiscalPeriod = {<=201302'} >}NetSales)


The * requests the intersect of the two conditions, i.e. everything between the two dates in this case.


I hope that helps.  Let me know how you get on.




Steve

pgrenier
Partner - Creator III
Partner - Creator III

Good day,

I believe the proper expression would be the following:

=Sum({<FiscalPeriod = {">=201212"} * {"<=201302"} >} NetSales)

Regards,

Philippe

Not applicable

Good spot Phillippe!! 

v_iyyappan
Specialist
Specialist

Hi,

Do u check the FiscalPeriod Dateformat like "201212". If it is not means please change the Dateformat FiscalPeriod as 'YYYYMM'.

And use the expression like

=Sum({<FiscalPeriod={'>=201212 <=201302'}>}NetSales)

Regards,