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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

I'm getting a different results from Qlikview script and set analysis expression. Please let me know where i am doing a mistake.

I'm getting a different results from Qlikview script vs set analysis expression. Please let me know where i am doing a mistake.

Script Expression:

Count(DISTINCT If( (Col1>= Date(AddMonths(Today(), -1), 'DD/MM/YYYY') and Col1<= Date(Today(), 'DD/MM/YYYY'))

   AND ( LOGON_IND='Y' OR MOB_IND= 'Y' OR TBLT_ND='Y' OR FLG='Y' )

                    , NO))

SET Analysis Expression:

Count({$<Col1= {">=$(=Date(AddMonths(Today(), -1), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}> * (<LOGON_IND={'Y'}> + <MOB_IND={'Y'}> + <TBLT_IND={'Y'}> + <FLG={'Y'}> )}  DISTINCT NO)

5 Replies
Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Since I have no idea over which dimensions you aggregate this count in the script and in the charts I can't tell what's wrong. Perhaps you can post a small qlikview document that illustrates the problem.


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

Also do you know what the result should be ?

Otherwise deciding which is right and which is wrong will be tricky.

Anonymous
Not applicable
Author

There is no dimension. For some reason i can't post the document.

Anonymous
Not applicable
Author

Is it possible to let me know what other way i can write the OR condition with And logical operator.

* (<LOGON_IND={'Y'}> + <MOB_IND={'Y'}> + <TBLT_IND={'Y'}> + <FLG={'Y'}> )


Please refer below complete expression::

Count({$<Col1= {">=$(=Date(AddMonths(Today(), -1), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}> * (<LOGON_IND={'Y'}> + <MOB_IND={'Y'}> + <TBLT_IND={'Y'}> + <FLG={'Y'}> )}  DISTINCT NO)

sunny_talwar

Can you maybe create a master flag in the script?

If(LOGON_IND = 'Y' or MOB_IND = 'Y' or TBLT_IND = 'Y' or FLG = 'Y', 1, 0) as MasterFlag

and then use this expression:

Count({$<Col1= {">=$(=Date(AddMonths(Today(), -1), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}, MasterFlag = {1}>}  DISTINCT NO)

Alternatively, if the flags are residing in different tables, you can try this out as well:

Count({$

<Col1= {">=$(=Date(AddMonths(Today(), -1), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}, LOGON_IND={'Y'}> +

<Col1= {">=$(=Date(AddMonths(Today(), -1), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}, MOB_IND={'Y'}> +

<Col1= {">=$(=Date(AddMonths(Today(), -1), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}, TBLT_IND={'Y'}> +

<Col1= {">=$(=Date(AddMonths(Today(), -1), 'DD/MM/YYYY'))<=$(=Date(Today(), 'DD/MM/YYYY'))"}, FLG={'Y'}>}

DISTINCT NO)