Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis with two period variables

Goodmorning all,

I want to create weborders (PostingReference) with '1'  operator for Total orders based on Year and Month.

unfortunatly, the following set analysis expression doesn't work:

=(count(DISTINCT{1<Year={$(=Only(Year))},<Month={$(=Only(Month))}>}PostingReference))

What did i wrong?

Thanks regards,

Rega

1 Solution

Accepted Solutions
Chanty4u
MVP
MVP

remove  "<" this

=(count(DISTINCT{1<Year={$(=Only(Year))},Month={$(=Only(Month))}>}PostingReference))

View solution in original post

5 Replies
tamilarasu
Champion
Champion

Hi Rega,

I can see one extra angle bracket in your set analysis.

=(count(DISTINCT{1<Year={$(=Only(Year))}, < Month={$(=Only(Month))}>}PostingReference))

Reomve the angle bracket and try,

=count(DISTINCT{1<Year={$(=Only(Year))},Month={$(=Only(Month))}>}PostingReference)

Chanty4u
MVP
MVP

remove  "<" this

=(count(DISTINCT{1<Year={$(=Only(Year))},Month={$(=Only(Month))}>}PostingReference))

Kushal_Chawda

try this

(count(DISTINCT{1<Year={"$(=max(Year))"},Month={"$(=max(Month))"}>}PostingReference))

Not applicable
Author

Hi Rega Sanyoto,

Try this:

=(count(DISTINCT{1<Year={"$(=Only(Year))"}, Month={"$(=Only(Month))"}>}PostingReference))

Regards,

Anjali Gupta

jonathandienst
Partner
Partner

As set analysis is calculated globally, the Only() function for year and month will return null() -- unless there is only on possible value for year and month in the entire data model. You may be able to use Max() instead. You need to quote the search expressions as well:

=count(DISTINCT {1<Year={"$(=Max(Year))"},<Month={"$(=Max(Month))"}>} PostingReference)

Do you want to ignore all selections? If you wish to override only the year and month values, then drop the "1":

=count(DISTINCT {<Year={"$(=Max(Year))"},<Month={"$(=Max(Month))"}>} PostingReference)

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