Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Code - dont know where to insert

Hello again,

i ve got:

- Max(aggr(Count (DISTINCT ITEMID), IME_I_PREZ))// Definition

and

- =Num(Max(aggr(Count (DISTINCT ITEMID), IME_I_PREZ)),'####### ### ###','.')// TEXTOBJECT

I have to attach the following(to each one)

(if(WildMatch(COMMISSSALESGROUP, KOM)=1

Could somebody pls tell me where to put the last formula and how the whole Definition should look like?

Thank you.

Kristian

1 Solution

Accepted Solutions
swuehl
MVP
MVP

maybe

Num(Max(aggr(Count (DISTINCT if(WildMatch(COMMISSSALESGROUP, KOM), ITEMID)), IME_I_PREZ)),'####### ### ###','.')

I assume that your if() statement if working on its own correctly. It's always a good idea to explain a bit the data model and field contain, e.g. what is the content of field(s) COMMISSSALESGROUP and KOM.

Maybe you could also just use:

Num(Max(aggr(Count (DISTINCT if(COMMISSSALESGROUP=KOM, ITEMID)), IME_I_PREZ)),'####### ### ###','.')

Depending on your data model, you probably need to add COMMISSSALESGROUP to you aggr() dimensions, too (maybe also your KOM field):

Num(Max(aggr(Count (DISTINCT if(WildMatch(COMMISSSALESGROUP, KOM), ITEMID)), IME_I_PREZ,COMMISSSALESGROUP, KOM)),'####### ### ###','.')

As I said, the more you could tell us, the better (incl. some sample data lines).

Regards,

Stefan

View solution in original post

4 Replies
swuehl
MVP
MVP

With this kind of problem description it's only a wild guessing what you want / need to achieve here.

Your if() statement obviously misses the then / else branches, so it could be as simple as:

=if(wildmatch( COMMISSSALESGROUP, KOM) =1, num(max(aggr( count( distinct ITEMID), IME_I_PREZ)),'####### ### ###','.') )

Not applicable
Author

Hello,

I want that the Definitions calculate only the values where the Wildmatch criteria is given.

Your formula sadly dont work.

Greetings,

Kristian

swuehl
MVP
MVP

maybe

Num(Max(aggr(Count (DISTINCT if(WildMatch(COMMISSSALESGROUP, KOM), ITEMID)), IME_I_PREZ)),'####### ### ###','.')

I assume that your if() statement if working on its own correctly. It's always a good idea to explain a bit the data model and field contain, e.g. what is the content of field(s) COMMISSSALESGROUP and KOM.

Maybe you could also just use:

Num(Max(aggr(Count (DISTINCT if(COMMISSSALESGROUP=KOM, ITEMID)), IME_I_PREZ)),'####### ### ###','.')

Depending on your data model, you probably need to add COMMISSSALESGROUP to you aggr() dimensions, too (maybe also your KOM field):

Num(Max(aggr(Count (DISTINCT if(WildMatch(COMMISSSALESGROUP, KOM), ITEMID)), IME_I_PREZ,COMMISSSALESGROUP, KOM)),'####### ### ###','.')

As I said, the more you could tell us, the better (incl. some sample data lines).

Regards,

Stefan

Not applicable
Author

Thank you. It works now, the first one was correct.

Next time ill try to give more infos, but thank you for your help.