Skip to main content
Announcements
Qlik Community Office Hours - Bring your Ideation questions- May 15th, 11 AM ET: REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
swarup_malli
Specialist
Specialist

A very challenging requirement using set analysis ?

Hi!

i have a requirement , where i have to write a set expression with the requirments given below

where

i have to find the sum of donations by employee ,

  - with distinct account numbers  ( field name is      indacctno)

- exclude account number starting with zero

- where totaldonation > 0 ( field name is totaldonation ) in a year ( year is a field)

this is what i have written , now i have to implement the above requiremnts in the expression given below .

sum ({$<CAMPAIGNTYPE ={'Empl'}>} DCDetails.TOTALDONATION)

Regards

Swarup

1 Solution

Accepted Solutions
Not applicable

Hi Swarup,

I have attached a sample file which I hope provides you with a solution - the chart highlighted in "blue" in the bottom right reflects the correct results & total per my understanding of the problem.

The expression I used for the TotalDonations is as follows:

=sum({<indacctno -= {"= Match (left (indacctno,1), '0')"}, campaigntype={'Empl'}>} totaldonation)

For others who may read this post please note how 'value' must be surrounded by {} when used in a set expression e.g. {'Empl'}

BUT not if the 'value' is used inside a double-quote "statement..." e.g. "= ....., '0')" per above. There are no {} around the '0'

Hope this helps.

Cheers,

Craig

View solution in original post

2 Replies
Not applicable

Hi Swarup,

I have attached a sample file which I hope provides you with a solution - the chart highlighted in "blue" in the bottom right reflects the correct results & total per my understanding of the problem.

The expression I used for the TotalDonations is as follows:

=sum({<indacctno -= {"= Match (left (indacctno,1), '0')"}, campaigntype={'Empl'}>} totaldonation)

For others who may read this post please note how 'value' must be surrounded by {} when used in a set expression e.g. {'Empl'}

BUT not if the 'value' is used inside a double-quote "statement..." e.g. "= ....., '0')" per above. There are no {} around the '0'

Hope this helps.

Cheers,

Craig

swarup_malli
Specialist
Specialist
Author

Hi Craig,

Thank you for helping me out.

Regards

Swarup