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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Show Budject count as on

Hi All,

I have a requirement to show the below scenario in Text Object. Could you please help me.

Scenario:

In the Text Object, I want to show Budject count as on.

The requirement is if you select Quarter or Month it will  display corresponding Quarter and Month.

if you don't make any selection it will display as on .

I used this code:

=if(Quarter='Q4',Round(sum(Number)),
if(GetSelectedCount(Quarter) > 0,Round(sum(Number)/3),
if(GetSelectedCount(month) > 0,sum(Number),
Sum({<m ={'03-01-2016'}>}Number))))

it is working. But I need simple code with dynamically changing by Quarter and  Month. Pls find attached qvw.


Thanks,

Krishna

1 Solution

Accepted Solutions
sunny_talwar

May be this?

=if(Quarter='Q4',Round(sum(Number)),

if(GetSelectedCount(Quarter) > 0,Round(sum(Number)/3),

if(GetSelectedCount(month) > 0,sum(Number),

  Sum({<m ={"$(=Date(Max(m), 'MM-DD-YYYY'))"}>}Number))))

View solution in original post

5 Replies
sunny_talwar

Dynamic based on what? selection in m?

sunny_talwar

May be this?

=if(Quarter='Q4',Round(sum(Number)),

if(GetSelectedCount(Quarter) > 0,Round(sum(Number)/3),

if(GetSelectedCount(month) > 0,sum(Number),

  Sum({<m ={"$(=Date(Max(m), 'MM-DD-YYYY'))"}>}Number))))

Anonymous
Not applicable
Author

Hi Sunny,

The requirement is if you select Quarter or Month it will  display corresponding Quarter and Month.

if you don't make any selection it will display as on .

Anonymous
Not applicable
Author

Hi Sunny,,

=if(Quarter='Q4',Round(sum(Number)),

if(GetSelectedCount(Quarter) > 0,Round(sum(Number)/3),

if(GetSelectedCount(month) > 0,sum(Number),

  Sum({<m ={"$(=Date(Max(m), 'MM-DD-YYYY'))"}>}Number))))

Your code is working fine. how can i change Quarter Dynamically(Q4)

Thanks,

Krishna.

sunny_talwar

Krishna,

I am having difficultly understanding your if condition. What exactly do you want to see when Quarter is selected and when Month is selected? and What happens when both are selected?