Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set Analysis Help

Hi,

I am not too sure how to use set analysis properly and have been trying to put it into this formula:

(

sum(if(year(TransactionDate)=Year(today()),[Total Incurred],0)))/



(
sum(

GrossPremium

*

(



if(Year([Day Earnt])=Year(Today()),[Earn Ratio],0)

)))

however i am not haviing any luck.

If someone could point me in the right dierection that would be great.

Many thanks.

8 Replies
Sokkorn
Master
Master

Hi Sir,

I would suggest to create a new fields for set analysis, something like

[Table]:

LOAD

...

Year([TransactionDate])    AS [TranYear],

Year([Day Earnt])    AS [DayEarntYear],

...

Then use set analysis below:

Sum({$<[TranYear] = {$(=Year(Today()))}>} [Total Incurred])/Sum({$<[DayEarntYear] = {$(=Year(Today()))}>} [Earn Ratio]*[GrossPremium])

Regards,

Sokkorn

Not applicable
Author

Thanks for your response.

How would i go about putting another condition in this e.g. colour = green?

Sokkorn
Master
Master

Hi,

If you want to add more condition, then try

Sum({$<[TranYear] = {$(=Year(Today()))}, [Colour]={'Green'}>} [Total Incurred])/Sum({$<[DayEarntYear] = {$(=Year(Today()))}, [Colour]={'Green'}>} [Earn Ratio]*[GrossPremium])

Make sure you are trying to add more condition not Text colore.

Regards,

Sokkorn

Not applicable
Author

Sum({$<[TranYear] = {$(=Year(Today()))}, [Colour]={'Green'}>} [Total Incurred])/Sum({$<[DayEarntYear] = {$(=Year(Today()))}, [Colour]={'Green'}>} [Earn Ratio]*[GrossPremium])

There seems to be a bit of a problem with the }, after year(Today()))) Its comes up with error in set modifier expression

Sokkorn
Master
Master

Hi Sir,

Does it work or not? and can you attached sample app?

Regards,

Sokkorn

Not applicable
Author

Hi,

I have just tried this

Sum

({$<EventTransactionDateYear={$(=Year(Today()))},[Colour]={Green}>} [Total Incurred])/



Sum({$<DayEarntYear={$(=Year(Today()))}, [Colour]={Green}>} [Earn Ratio]*[GrossPremium])

In the expression editor it says 'Expression OK' however when you click ok it says taht no data cannot be displayed in the chart.

er_mohit
Master II
Master II

Sum({$<DayEarntYear={"$(=max(DayEarntYear))"}, [Colour]={Green}>} [Earn Ratio]*[GrossPremium])

or

Sum({<DayEarntYear={$(=year(date(today()))}, [Colour]={Green}>} [Earn Ratio]*[GrossPremium])


Sokkorn
Master
Master

Hi,

Use [Colour]={'Green'} not [Colour]={Green}

Regards,

Sokkorn