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

Announcements
Independent validation for trusted, AI-ready data integration. See why IDC named Qlik a Leader: Read the Excerpt!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How to Combine 2 Expressions into One Expression

Hi Guys / QlikCommunity:

I have this Expression:-

=sum(if(transdate<CurrentDate -2,Qty))

And also this Expression:-

sum (if (invtype='20',goodqty)) - sum (if (invtype='34',goodqty))

+

sum (if (invtype='40',goodqty)) - sum (if (invtype='42',goodqty))

I need to combine both Expressions into one Expression.

I am not able to use Set Analysis for my Expression.

Could someone enlighten me how to do it?

Thanks a lot guys…

12 Replies
gandalfgray
Specialist II
Specialist II

richardgan is using 7.5 and can't use set expr because of that...

Not applicable
Author

Hi Guys and aadilmadarveet:

GandalfGray is right I am not able to use Set Analysis as I am using Qlikview 7.5 and it does not support Set Analysis for that.

I think I will need to change the Expression as it takes very long time to long and the data looks funny.

Once I have the answer to that I will post my scrip and Expression in this post so that others can have a look.

Thank you guys for the kind and great help.

Not applicable
Author

Guys thanks you so much for your kind help.

I decided to check the Expression to the following and it works BUT there is one Big Problem.

(

(Sum (if(year(InventoryDate1)<=(year(varcurrdate))

and Inventorymonth1<month(varcurrdate)

and (InventoryDate1< varcurrdate)

and (invtype='34'),InventoryGoodqty)))

-

(Sum (if(year(InventoryDate1)<=(year(varcurrdate))

and Inventorymonth1<month(varcurrdate)

and (InventoryDate1< varcurrdate)

and (invtype='20'),InventoryGoodqty)))

)

+

(

(Sum (if((year(InventoryDate1)<=year(varcurrdate))

and (invtype='40') and locid='0000'

,InventoryGoodqty)))

-

(Sum (if((year(InventoryDate1)<=year(varcurrdate))

)

and (invtype='42') and locid='0000'

,InventoryGoodqty)))

)

After checking the data. The Opening Balance should be the Closing month balance for the pervious month. The Above Expression is the Opening Balance.

The Closing Balance is as Follows:-

[Opening Bal] + [MTD Variance]

I am trying to include the Expression for Closing Balance as the Opening Balance for the following month.

Any kind soul, please enlighten me. 

Thanks guys for your wonderful and helpful feedback.