Qlik Community

QlikView Creating Analytics

Discussion Board for collaboration related to Creating Analytics for QlikView.

canmarroig
New Contributor III

Action buttons on two variables

Hi, i'm facing this problem: i've a bar graph where i'm showing

sum(sales)

count(customers)

sum(goodsdelivered)

etc.

My customer is asking me to have an action button for switching from sum to avg. No problem i've created a variable vAggr to do it

if(vAggr='sum', sum(sales), if(vAggr='avg', avg(sales))

Then he asked me to cycle on time dimension not with a classic QV symbol but he wants further buttons to set Year, Month,ecc

I tried with a further variable vTime but when i try to use it, it stops calculating avg. I use this expression:

if(vAggr='sum', sum(sales), if(vAggr='avg', sum(sales)/count (distinct $(vTime)))

Where is the problem, i can't see it. Tks

Tags (2)
7 Replies
Not applicable

Re: Action buttons on two variables

Hi,

What you have in the variable $(vTime)

v_iyyappan
Valued Contributor

Re: Action buttons on two variables

Hi,

I assume vTime like Year, Month based on button selection it will change the Year or Month.

using the Conditional option in expression use like this

vTime = 'Year'

if(vAggr='sum', sum(sales), if(vAggr='avg', sum(sales) / Count (distinct Year)))

vTime = 'Month'

if(vAggr='sum', sum(sales), if(vAggr='avg', sum(sales) / Count (distinct Month)))


Hope its help.


Otherwise provide the sample app for that


Regards,

Not applicable

Re: Re: Action buttons on two variables

Hii Amuthabharati,

I am attaching a file for the same button action, go for it ,

Hope it helps.

MVP
MVP

Re: Action buttons on two variables

Hi,

Please find attached file, hope it helps you.

Regards,

Jagan.

canmarroig
New Contributor III

Re: Action buttons on two variables

I've Year, Month, Week, Fiscal Quarter, Date

canmarroig
New Contributor III

Re: Action buttons on two variables

Yes, correct for sum or avg but also to cycle on x axis dimension i need furrther buttons

MVP
MVP

Re: Re: Action buttons on two variables


Hi,

PFA file for solution.

Regards,

Jagan.

Community Browser