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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
prashantsanchet
Creator
Creator

Do not want aggreate value to compare

Hi All,

I have a requirement where

I have dimension called as strategy and has measure called as sum(sales).

Now i need to divide a strategy as long based on some condition like  if( sum(revenue) >=0,sum(sales)) as newsales


I have different chart with new chart with dimension as   owner and newsales as measure but i dont have strategy as dimention in this chart.


Now the newsales calculation is coming null as its getting aggregated but i want to only show the owner with strategy as long

4 Replies
jonathandienst
Partner - Champion III
Partner - Champion III

Do you want to group the calculation by strategy? Perhaps this:

     Sum(Aggr(If(Sum(revenue) >= 0, Sum(sales)), strategy, owner))

[owner] is part of the Aggr() because it is the chart dimension.

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

you can try an Expression like this

if(aggr(sum(revenue),YOURDIMENSION)>=0, sum(sales), '<0')

prashantsanchet
Creator
Creator
Author

Hi ,

The requirement is like i have strategy dimension. I need to show the count of long strategy into KPI in qliksense

i need to classify the strategy into long and short based on

if ( sum(revenue) >=0 , then 'L' else short )

But the problem with this is sum(revenue) will give you only one value . But i want to compare each value of revenue based on strategy and classify them as short or long.

if(match(

if( aggr(sum([revenue]),strategy)

>=0,'L','S'),'L'),count(distinct([strategy])))

Please reply asap

zhadrakas
Specialist II
Specialist II

try like this

if(if(aggr(sum(revenue), strategy)>=0 'L', 'S')='L',count(distinct strategy), '#ELSE#')