Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

why is not ok for same expression.

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?

14 Replies
PrashantSangle

Hi,

I am not sure but try this expression

=COUNT({<SHOPKEY= {"=sum(SALES) > 0"},YEAR={'$(=max(YEAR))'}>}DISTINCT  SHOPKEY)

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

get wrong number

PrashantSangle

Hi,

Can you post your sample data,

and what is your dimension?

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Not applicable
Author

like example:

   sales     201401   201301      count(result)

shop1      234        230           1

shop2      0            230           0

shop3       344         0              0

shop4      0             0              0

shop5    -400        234          0

jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Is the field "YEAR" or "year". QV field names are case sensitive, so these are not the same field. Set analysis simply ignores invalid field names.

HTH

Jonathan

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein