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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Expression is not working

Hi,

Pls find the attached xls file along with dashboard, For Apple Product, I wanted to see Sales data from current month to future.

Not sure whats wrong in my expression: =IF([Product Cat]='Apple' and month(Date)>=Month(Today()), SUM(Sales),0)

I am trying to display data for Apple from Dec to future months

For Samsung whatever data is there.

I am using personal edition. Attached screenshot might help what I am expecting.

Appreciate your help.

Thanks,

13 Replies
lironbaram
Partner - Master III
Partner - Master III

hi

use this expression

=sum(IF([Product Cat]='Apple' ,if( month(Date)>=Month(Today()), Sales,0),Sales))

amit_saini
Master III
Master III

Madu,

Like this????

Thanks,
AS

rajeshvaswani77
Specialist III
Specialist III

Hi Madu,

This is the correct formula

=IF([Product Cat]='Apple' and (Num(Month(Date))>=Num(Month(Today()))), SUM(Sales),0)

Looks like you have no data that will satisfy this condition.

thanks,

Rajesh Vaswani

Not applicable
Author

Hi Liron,

I tried this formula, but I get only Dec in 2014 for Apple product, but missing all future data for 2015 which is not supposed to be.

Kindly have a look at the attached screenshot.

Thanks,

Not applicable
Author

No Rajesh, I have data which is satisfying and you can see the attached xls file.

Thanks,

jagan
Partner - Champion III
Partner - Champion III

Hi,

Use this expression

=Sum({<[Product Cat]= {'Apple'}, Date={'>=$(=MonthStart(Today()))'} >}Sales)

Regards,

jagan.

Not applicable
Author

Hi Jagan,

I tried this formula

=IF([Product Cat]='Apple',Sum({<[Product Cat]= {'Apple'}, Date={'>=$(=MonthStart(Today()))'} >}Sales),SUM(Sales))

because I don't want miss Samsung product.

Formula looks like doing it by date, I believe it supposed to be on monthly data.

But I am not supposed to get Nov data for Apple product. Attached screen shot is the output of using above formula.

Thanks,

Not applicable
Author

in your screen shot you are getting nov data for product A for year 2104 not for 2014,first correct your date then try the expression suggested by jagan

jagan
Partner - Champion III
Partner - Champion III

Hi,

That Nov is of year 2104, it is not for the year of 2014.  The expression works correct even if you month or date.

Hope this helps you.

Regards,

Jagan.