Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
the express is ok :
: COUNT({<SHOPKEY= {"=(sum(SALES>0)"} DISTINCT SHOPKEY) is ok .
the same :
COUNT({<SHOPKEY= {"=(sum(year={"$(=max(year)-1)"}SALES>0)"} DISTINCT SHOPKEY) isn't ok ,why ?
I want to get the number of shop which have sales in the the two year's same monthes .
example:
sales 201401 201301 count(result)
shop1 234 230 1
shop2 0 230 0
shop3 344 0 0
how to write it in table?
Hi,
Try this
COUNT({<SHOPKEY= {'=(sum(year={"$(=max(year)-1)"}SALES>0)'} DISTINCT SHOPKEY)
OR
COUNT({<SHOPKEY= {'=(sum(year={$(=max(year)-1)}SALES>0)'} DISTINCT SHOPKEY) -- For Year(numeric) there is no need of Quotes.
Regards,
jagan.
Because the second should be:
COUNT({<SHOPKEY= {"=(sum(year={"$(>=max(year)-1)"}SALES>0)"} DISTINCT SHOPKEY)
that is >= last year
Hi,
You cannot use " inside "
Try to use ' ' for inner expression
try this:
COUNT({<SHOPKEY= {"=(sum({<year={"$(=max(year)-1)"}>}SALES>0)"} DISTINCT SHOPKEY)
yes ,I can't use inside . but this I want two year's data the same time .
Hi,
Try this
COUNT({<SHOPKEY= {'=(sum(year={"$(=max(year)-1)"}SALES>0)'} DISTINCT SHOPKEY)
OR
COUNT({<SHOPKEY= {'=(sum(year={$(=max(year)-1)}SALES>0)'} DISTINCT SHOPKEY) -- For Year(numeric) there is no need of Quotes.
Regards,
jagan.
Hi
The above responses are all nearly there, this one fixes the bracket positions and closes the set expressions properly:
COUNT({<SHOPKEY= {"=sum({<year={'$(=max(year) - 1')}>} SALES) > 0"}>} DISTINCT SHOPKEY)
HTH
Jonathan
it is ok for last year's 'sale. but I can't get result like my example :
one :
COUNT({<SHOPKEY= {"=sum({<YEAR={'$(=max(YEAR))'}>} SALES) > 0"}-{"=sum({<YEAR={'$(=max(YEAR)-1)'}>} SALES) <=0"}>} DISTINCT SHOPKEY)
second
COUNT({<SHOPKEY= {"=sum({<YEAR={'$(=max(YEAR))'}>} SALES) > 0"},SHOPKEY={"=sum({<YEAR={'$(=max(YEAR)-1)'}>} SALES) <=0"}>} DISTINCT SHOPKEY)
It seems the same sales.
Hi,
Try this
1st expression:
=COUNT({<SHOPKEY= {"=sum({<YEAR={'$(=max(YEAR))'}>} SALES) > 0">}DISTINCT SHOPKEY)
-COUNT({<SHOPKEY={"=sum({<YEAR={'$(=max(YEAR)-1)'}>} SALES) <=0"}>} DISTINCT SHOPKEY)
but some shops is counted twice because both is zero.