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: 
bharatkishore
Creator III
Creator III

Expression in Straight Table

Hi All,

I have 10 fields in a list box by writing an load * inline statement. I have written the below expression in the straight table chart

=sum(IB_1)

Now my problem is,this expression should be changed whenever i select a field(Flag) the expression should be changed to sum(IB).

If i un-select flag then it should be changed to sum(IB_1).

Attached qvw for reference.

Is it possible to achieve.

Thanks,

Bharat

1 Solution

Accepted Solutions
sunny_talwar

May be this

=If(SubStringCount('|' & Concat(distinct Dimension2, '|') & '|', '|Flag|'), Sum(IB), Sum(IB_1))

View solution in original post

5 Replies
sunny_talwar

May be this

=If(SubStringCount('|' & Concat(distinct Dimension2, '|') & '|', '|Flag|'), Sum(IB), Sum(IB_1))

mayankraoka
Specialist
Specialist

Hi Bharat,

If I understand your requirement correctly here is the solution.

Please find attached qvw

Regards,

Mayank !

bharatkishore
Creator III
Creator III
Author

Thanks Sunny....You are just Awesome...

One more thing after writing this expression based on the month selection the value should effect.

For example: if i select jan the value should be (expression)/1 , if  i select feb (expression)/2 , if i select march (expression)/3  if i april (expression)/4.. Can you please tell me how to achieve this..

sunny_talwar

May be this

=If(SubStringCount('|' & Concat(distinct Dimension2, '|') & '|', '|Flag|'), Sum(IB), Sum(IB_1))/Month(Period_NR)

bharatkishore
Creator III
Creator III
Author

Thanks Genius.. Sorry Missed the trick..