Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Set analysis with IF statement

Hi All,

I am creating drill down reports, there are three level of reports, when the user select the paticular metrics(Count of ID) in the first report, he will able to see the next level details associated with those selected IDs. so  i have used Inline table(field Name Metricslable) to link to different metrics shown in the first report.

I have used a expression like this:

if(Metricslable='metric1',count({<Dim1={'aa'},year=,month=,ID=>}ID),

if(Metricslable=''metric2',count({<Dim1={bb},year=,month=,ID=>}ID))

I want  to exclude the some filter selection, Year and month filter exclusion is working fine, but my ID slection is not workinfg fine.

5 Replies
anbu1984
Master III
Master III

Can you post sample qvw

avinashelite

Hi Sampath,

Please post your app and the exact requirement

senpradip007
Specialist III
Specialist III

Try like:

count({<Metricslable={'metric1'}, Dim1={'aa'},year=,month=,ID=> +

          <Metricslable={'metric2'}, Dim1={'bb'},year=,month=,ID=>} ID)

PrashantSangle

Hi,

When you nullify ID field in your set analysis then it will give you wrong output.

Change your expression to

Count({<Metricslable={'metric1'}, Dim1={'aa'},year=,month=>}ID)

+

Count(<Metricslable={'metric2'}, Dim1={'bb'},year=,month=>} ID)

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
jonathandienst
Partner - Champion III
Partner - Champion III

Hi

Are you trying to create drill-down/rollup functionality? Something like Year | Month | Date - so that the chart displays Year by default; if you select a year it shows the data by months in the selected year; and if you select a month, it shows data by Date in that month?

If so, rather use QV built in functionality using drill groups rather than building complex logic, and use the drill group as the dimension in the chart.  Check out groups and drill groups in the manual.


Your solution would look something like this:

Eg drill group grYMD - year, month, date

Use grYMD as the dimension, and something like Count(ID) as the expression

(Adapt to your specific requirements)

HTH

Jonathan

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