Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
tizianacaem
Partner - Contributor
Partner - Contributor

Set Analisys question

Hi all,

I'm having some problems with a set analisys expression, someone can help me solve it? The expression is this one:

count

(distinct {$<Anno_iscrizione = {$(#=Only(FatAnno)-1)}, Mese_iscrizione= {$(#=Only(FatMese))}>} CLIENTE)



I don't know if its possible to use Count disctinct in set analisys and if my synthass is correct

I would really appreciate some clarifications or indications..

thanks

Tiziana

8 Replies
Miguel_Angel_Baeyens

Hello Tiziana,

Everything seems to be allright, except for

Count({set} DISTINCT CLIENTE)
using DISTINCT keyword after the set. Hope this helps.

tizianacaem
Partner - Contributor
Partner - Contributor
Author

thank you for your help!

Actually in this way works, but only if i delete the secon condition (the one of mounth)

some other idea?

Miguel_Angel_Baeyens

How do you store FatMese field (which format) in your data source? If you try for example to get with set analysis those who

{< FatMese = {3} >}
does the chart work?

tizianacaem
Partner - Contributor
Partner - Contributor
Author

FatMese is like gen, feb, mar etc. if i use 3 is doesn't work, instead it work correct if i use mar.

tizianacaem
Partner - Contributor
Partner - Contributor
Author

I take advantage of your availability to ask one more question:

if i want to show the percentuage of single month respect the full year, is correct (but i think no as it doesn't work) this syntax:

sum

( {$<FatAnno = {$(#=Only(FatAnno)-1)}>} System_Net_Amount)/sum( {1<FatAnno = {$(#=Only(FatAnno)-1)}>} total System_Net_Amount )





Miguel_Angel_Baeyens

Depending on how are your dimensions built (I'd recommend to add "Month" as dimension, actually), something like the following should work to get month results of total year results

sum({$< FatAnno = {$(#=Only(FatAnno)-1)} >} System_Net_Amount) / sum({1< FatAnno = {$(#=Only(FatAnno)-1)} >} System_Net_Amount)


Hope this helps

tizianacaem
Partner - Contributor
Partner - Contributor
Author

Bad news.. in this way the result is 100% in every row, rather than the percentage for the year that i'm considering..

For the current year (Max (TOTAL Year) ) i usually use

Sum (System_Net_Amount)/Sum (Total System_Net_Amount)

but i'm not able to translate this condition with setAnalisys for (Max (TOTAL Year) )-1

The month is already a dimension.

i don't know what to do.. any other ideas??

Thank you very much

tizianacaem
Partner - Contributor
Partner - Contributor
Author

thank you for your help.. i find the solution writing total before the SysteNetAmount..

now is working correctly!!!