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: 
danialier
Creator III
Creator III

Error in formula...

Hello,

For some reason the formula below does not work... What I want is to have the result of doing; units from CompanyA in the last period (so the current period) minus units from CompanyZ in the previous period.

=num(sum({<Vendor={'CompanyA'},Period={$(=Max(Period))}>}units)-sum({<Vendor={'CompanyA'},Period={$(=Max(Period)-1)}>}units))

thks,dani

6 Replies
Not applicable

try this :

=num(sum({$<Vendor={'CompanyA'},Period={'$(=Max(Period))'}>}units)-sum({$<Vendor={'CompanyA'},Period={'$(=Max(Period)-1)'}>}units))

MK_QSL
MVP
MVP

Use as per below to get the Grown in Unit compare to last month.


=num(sum({<Vendor={'CompanyA'},Period={"$(=Max(Period))"}>}units)-

sum({<Vendor={'CompanyA'},Period={"$(=Max(Period)-1)"}>}units))


Also make sure that your format of your Period and $(=Max(Period)-1) should be same.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

I guess the CompanyZ you're referring to in your question is a typing mistake?

Peter

Anonymous
Not applicable

the error could be in the Period={$(=Max(Period))}>} because you can try like this by seeing below syntax

syntax 1: DayOfYear = {"<=$(=max({<FiscalYear={$(=vCY)}>} DayOfYear))"}

If it does not work please post the qvw file it would be easy to solve.

santharubban
Creator III
Creator III

try this

=num(sum({<Vendor={'CompanyA'},Period={'$(=Max(Period))'}>}units)-

sum({<Vendor={'CompanyA'},Period={'$(=Max(Period)-1)'}>}units))

aveeeeeee7en
Specialist III
Specialist III

Hi Dani

Try this:

=num(sum({<Vendor={'CompanyA'},Period={'$(=Max(Period))'}>}units))

-

num(sum({<Vendor={'CompanyA'},Period={'$(=Max(Period)-1)'}>}units))



Regards

Aviral