Qlik Community

Qlik Sense App Development

Discussion board where members can learn more about Qlik Sense App Development and Usage.

efv_infodata
New Contributor II

SetAttribute and sub-SetAttribute(Sum({<...>})=0)

hello,

I need some help to build a setattribute with sub-setattribute.

My model is simple.

doc:

Customer,

Year,

YearAgo ( load from year(Today() - Year)

Sales;

I'll found my 're-born' Customer; the one who have Sales on YearAgo=0 and without Sales on Yeargo=1

Here is my formula

Sum({$<YearsAgo={0},   Customer={" =Sum({$<YearsAgo={1}>} Sales)={0}" } > } Sales)

but I get 0.00 ... sure there is some.

What's wrong on the syntax?

Thanks for any help.

Manu

1 Solution

Accepted Solutions

Re: SetAttribute and sub-SetAttribute(Sum({<...>})=0)

Try this

Sum({$<YearAgo = {0}, Customer = e({<Customer = {"=Sum({$<YearAgo = {1}>} Sales) > 0"}>})>} Sales)

or this

Sum({$<YearAgo = {0}, Customer = e({$<YearAgo = {1}>})>} Sales)

5 Replies

Re: SetAttribute and sub-SetAttribute(Sum({<...>})=0)

Try this

Sum({$<YearsAgo = {0}, Customer = {"=Sum({$<YearsAgo = {1}>} Sales) = 0"}>} Sales)

efv_infodata
New Contributor II

Re: SetAttribute and sub-SetAttribute(Sum({<...>})=0)

sorry, it did'nt work....

doc:

load

  Customer,

  Year,

  year(today()) - Year as YearAgo,

  Sales

inline [

Customer,Year,Sales

a,2018,200

a,2017,200

b,2018,300

c,2017,100

];

qlik ReNew biz.PNG

Re: SetAttribute and sub-SetAttribute(Sum({<...>})=0)

Try this

Sum({$<YearAgo = {0}, Customer = e({<Customer = {"=Sum({$<YearAgo = {1}>} Sales) > 0"}>})>} Sales)

or this

Sum({$<YearAgo = {0}, Customer = e({$<YearAgo = {1}>})>} Sales)

efv_infodata
New Contributor II

Re: SetAttribute and sub-SetAttribute(Sum({<...>})=0)

I got it !

You can't select what is does'nt exist...

I must 'exclude' what's exist....

thank you for your help.

Re: SetAttribute and sub-SetAttribute(Sum({<...>})=0)

You got it

Community Browser