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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
DesmoArka
Partner - Contributor III
Partner - Contributor III

Nested set Analysis

Hi,

i have this expression that works fine in qlikview:

sum({<DTREG={'<=$(=DATE(MAX(DTREG)))'},ID_FATTURA={"=fabs(round(sum({<DTREG={'<=$(=DATE(MAX(DTREG)))'}>}DARE)-sum({<DTREG={'<=$(=DATE(MAX(DTREG)))'}>}AVERE),0.01))>0"}>}DARE)

It doesn't work on cloud.

I see that the formula

sum({<DTREG={'<=$(=DATE(MAX(DTREG)))'}>}DARE) works if written in this way:

sum({<DTREG={"<=$(=DATE(MAX(DTREG)))"}>}DARE)

The problem is in this piece:

..ID_FATTURA={"=fabs(round(sum({<DTREG={'<=$(=DATE(MAX(DTREG)))'}>}DARE)-sum({<DTREG={'<=$(=DATE(MAX(DTREG)))'}>}AVERE),0.01))>0"}

if i change ' with " i have expression error because there are to formulas nested.

Some advise?

Thanks a lot.

 

 

Labels (2)
2 Solutions

Accepted Solutions
p_verkooijen
Partner - Specialist II
Partner - Specialist II

Hi @DesmoArka 

This likely because the "bug" that you can use ' for a " has been fixed for a while, only applied in new documents. https://community.qlik.com/t5/New-to-Qlik-Analytics/Set-Analysis-QlikView-12-vs-Qlik-Sense/m-p/24825... 

In your case, you have to use [] instead of "" the inner SA search *

sum(
{<
DTREG={"<=$(=DATE(MAX(DTREG)))"},
ID_FATTURA={"=fabs(sum({<DTREG={[<=$(=DATE(MAX(DTREG)))]}>}DARE)-sum({<DTREG={[<=$(=DATE(MAX(DTREG)))]}>}AVERE))>0"}
>}
DARE)

* changed expression based on Hic's reply

Drop the ROUND(,0.01), does nothing in regard to > 0

View solution in original post

hic
Former Employee
Former Employee

Don't use single quotes - that means literals, i.e. not expressions.

To quote searches you can nest set analysis in three levels:

Double quotes: "..."
Square brackets: [...]
Grave accents `...`

Use them one by one in the three levels.

See also 
https://community.qlik.com/t5/Design/QlikView-Quoteology/ba-p/1476029
https://community.qlik.com/t5/Design/Quotes-in-Set-Analysis/ba-p/1471824

 

 

View solution in original post

2 Replies
p_verkooijen
Partner - Specialist II
Partner - Specialist II

Hi @DesmoArka 

This likely because the "bug" that you can use ' for a " has been fixed for a while, only applied in new documents. https://community.qlik.com/t5/New-to-Qlik-Analytics/Set-Analysis-QlikView-12-vs-Qlik-Sense/m-p/24825... 

In your case, you have to use [] instead of "" the inner SA search *

sum(
{<
DTREG={"<=$(=DATE(MAX(DTREG)))"},
ID_FATTURA={"=fabs(sum({<DTREG={[<=$(=DATE(MAX(DTREG)))]}>}DARE)-sum({<DTREG={[<=$(=DATE(MAX(DTREG)))]}>}AVERE))>0"}
>}
DARE)

* changed expression based on Hic's reply

Drop the ROUND(,0.01), does nothing in regard to > 0

hic
Former Employee
Former Employee

Don't use single quotes - that means literals, i.e. not expressions.

To quote searches you can nest set analysis in three levels:

Double quotes: "..."
Square brackets: [...]
Grave accents `...`

Use them one by one in the three levels.

See also 
https://community.qlik.com/t5/Design/QlikView-Quoteology/ba-p/1476029
https://community.qlik.com/t5/Design/Quotes-in-Set-Analysis/ba-p/1471824