Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
ALERT: QlikView server communication interruptions following Microsoft Windows Domain Controller security updates
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

FIX BY FIELD

Hello,

I need to use the number of registers in a month as a fixed variable,

I tried:

count (total<month>distinct ID)

but if I select another field the function doesn't return me the results of the whole month

I know that if I use:

count ({"field"}total<month>distinct ID)

and I select that specific field, it doesn't affect to the count, this solution is OK only for one field, but is there any way to include all the fields without having to type them between { } ?

Regards

Labels (1)
6 Replies
Not applicable
Author

Yes, use the 1 flag.

{1}

This set will encompass everything in your application, disregarding all selections.

Not applicable
Author

Thanks!

Can I make an exception using the 1 flag?

I need to select the month...

Not applicable
Author

Unfortunately not. You would then have to explicitly type in all field and "zero" them.

Not applicable
Author

Ok...

thanks for your help John!

johnw
Champion III
Champion III


dperte85 wrote: Can I make an exception using the 1 flag?
I need to select the month...




You should be able to make an exception to the {1} flag by using the P() notation to indicate "possible values". Something like this:

count({1<month=P()>} total <month> distinct ID)

If it doesn't work exactly like that, I can poke at it. I believe the "possible values" for month are affected by selections, so if you select a product, and it was only sold in March, I believe this would only give you March, even if it otherwise ignored the product. I'm sure there's a way around that as well if desired, such as by using getfieldselections() to insert a list of the actual selections for month if anything is selected.

Not applicable
Author

Interesting. Here is another perspective. Inside the P() we can use a "Logical Month" field, thereby excludiing the filters caused by the possible selections by the user!